class_docstr: A helper object to build a device infeed queue with input partition.
  
  Args:
    number_of_tuple_elements: the number of Tensors fed atomically through the
      queue, must be present unless it can be inferred from other arguments.
    device_assignment: A TPU `DeviceAssignment` which is used to place all the
      partitions to different TPU infeed queues.
    host_id: The id of the host machine.
    input_partition_dims: A nested list/tuple of integers. Each inner
      list/tuple describes how to partition the corresponding input tensor.
    tuple_types: If not None, a list of types of the elements of the queue.
    tuple_shapes: If not None, a list of shapes of the elements of the queue.
    name: The name of the queue.
class_docstr_tok: ["A","helper","object","to","build","a","device","infeed","queue","with","input","partition",".","Args",":","number_of_tuple_elements",":","the","number","of","Tensors","fed","atomically","through","the","queue",",","must","be","present","unless","it","can","be","inferred","from","other","arguments",".","device_assignment",":","A","TPU","`","DeviceAssignment","`","which","is","used","to","place","all","the","partitions","to","different","TPU","infeed","queues",".","host_id",":","The","id","of","the","host","machine",".","input_partition_dims",":","A","nested","list\/tuple","of","integers",".","Each","inner","list\/tuple","describes","how","to","partition","the","corresponding","input","tensor",".","tuple_types",":","If","not","None",",","a","list","of","types","of","the","elements","of","the","queue",".","tuple_shapes",":","If","not","None",",","a","list","of","shapes","of","the","elements","of","the","queue",".","name",":","The","name","of","the","queue","."]
docstr: Generate TPU dequeue ops.
  
  Args:
    tpu_device: The TPU device ordinal where the infeed instruction should be
      placed.
  
  Returns:
    A list of Outputs corresponding to a partition of infeed dequeued
    into XLA, suitable for use within a replicated block.
  
  Raises:
    ValueError: if the types or shapes of the tuple elements have not been
    set; or if a dequeue op has already been generated.
code: def generate_dequeue_op(self, tpu_device=0):
      """Generate TPU dequeue ops.
  
      Args:
        tpu_device: The TPU device ordinal where the infeed instruction should be
          placed.
  
      Returns:
        A list of Outputs corresponding to a partition of infeed dequeued
        into XLA, suitable for use within a replicated block.
  
      Raises:
        ValueError: if the types or shapes of the tuple elements have not been
        set; or if a dequeue op has already been generated.
      """
      self.freeze()
      if self._generated_dequeue_op and not ops.inside_function():
          raise ValueError(
              "Can't generate two dequeue Ops from the same queue"
          )
      self._generated_dequeue_op = True
      full_name = "%s/dequeue" % self._name
      sharded_shapes = [
          policy.get_sharded_shape(shape)
          for (shape, policy) in zip(
              self._tuple_shapes, self._sharding_policies
          )
      ]
      with ops.device(tpu_name_util.core(tpu_device)):
          values = tpu_ops.infeed_dequeue_tuple(
              dtypes=self._tuple_types,
              shapes=sharded_shapes,
              name=full_name,
          )
      return tag_sharding_attribute_for_dequeued_tensors(
          values, self._input_partition_dims
      )
  
imports: import itertools
  import numpy
  from tensorflow.python.compiler.xla.experimental import xla_sharding
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.tpu import tpu_name_util
  from tensorflow.python.tpu import tpu_sharding
  from tensorflow.python.tpu.ops import tpu_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling the _PartitionedInfeedQueue obj's underlying member method code with example usage: obj.generate_dequeue_op(tpu_device) and returns: tag_sharding_attribute_for_dequeued_tensors