Creates a queue that dequeues elements in a first-in first-out order. A `PaddingFIFOQueue` has bounded capacity; supports multiple concurrent producers and consumers; and provides exactly-once delivery. A `PaddingFIFOQueue` holds a list of up to `capacity` elements. Each element is
(self,
capacity,
dtypes,
shapes,
names=None,
shared_name=None,
name="padding_fifo_queue")
| 780 | """ |
| 781 | |
| 782 | def __init__(self, |
| 783 | capacity, |
| 784 | dtypes, |
| 785 | shapes, |
| 786 | names=None, |
| 787 | shared_name=None, |
| 788 | name="padding_fifo_queue"): |
| 789 | """Creates a queue that dequeues elements in a first-in first-out order. |
| 790 | |
| 791 | A `PaddingFIFOQueue` has bounded capacity; supports multiple concurrent |
| 792 | producers and consumers; and provides exactly-once delivery. |
| 793 | |
| 794 | A `PaddingFIFOQueue` holds a list of up to `capacity` elements. Each |
| 795 | element is a fixed-length tuple of tensors whose dtypes are |
| 796 | described by `dtypes`, and whose shapes are described by the `shapes` |
| 797 | argument. |
| 798 | |
| 799 | The `shapes` argument must be specified; each component of a queue |
| 800 | element must have the respective shape. Shapes of fixed |
| 801 | rank but variable size are allowed by setting any shape dimension to None. |
| 802 | In this case, the inputs' shape may vary along the given dimension, and |
| 803 | `dequeue_many` will pad the given dimension with zeros up to the maximum |
| 804 | shape of all elements in the given batch. |
| 805 | |
| 806 | Args: |
| 807 | capacity: An integer. The upper bound on the number of elements |
| 808 | that may be stored in this queue. |
| 809 | dtypes: A list of `DType` objects. The length of `dtypes` must equal |
| 810 | the number of tensors in each queue element. |
| 811 | shapes: A list of `TensorShape` objects, with the same length as |
| 812 | `dtypes`. Any dimension in the `TensorShape` containing value |
| 813 | `None` is dynamic and allows values to be enqueued with |
| 814 | variable size in that dimension. |
| 815 | names: (Optional.) A list of string naming the components in the queue |
| 816 | with the same length as `dtypes`, or `None`. If specified the dequeue |
| 817 | methods return a dictionary with the names as keys. |
| 818 | shared_name: (Optional.) If non-empty, this queue will be shared under |
| 819 | the given name across multiple sessions. |
| 820 | name: Optional name for the queue operation. |
| 821 | |
| 822 | Raises: |
| 823 | ValueError: If shapes is not a list of shapes, or the lengths of dtypes |
| 824 | and shapes do not match, or if names is specified and the lengths of |
| 825 | dtypes and names do not match. |
| 826 | """ |
| 827 | dtypes = _as_type_list(dtypes) |
| 828 | shapes = _as_shape_list(shapes, dtypes, unknown_dim_allowed=True) |
| 829 | names = _as_name_list(names, dtypes) |
| 830 | if len(dtypes) != len(shapes): |
| 831 | raise ValueError("Shapes must be provided for all components, " |
| 832 | "but received %d dtypes and %d shapes." % (len(dtypes), |
| 833 | len(shapes))) |
| 834 | |
| 835 | queue_ref = gen_data_flow_ops.padding_fifo_queue_v2( |
| 836 | component_types=dtypes, |
| 837 | shapes=shapes, |
| 838 | capacity=capacity, |
| 839 | shared_name=_shared_name(shared_name), |
nothing calls this directly
no test coverage detected