parameters: (tensors,
                     capacity=8,
                     shared_name=None,
                     name=None)
docstring: Creates a queue to prefetech tensors from `tensors`.
  
    A queue runner for enqueing tensors into the prefetch_queue is automatically
    added to the TF QueueRunners collection.
  
    Example:
    This is for example useful to pre-assemble input batches read with
    `tf.train.batch()` and enqueue the pre-assembled batches.  Ops that dequeue
    from the pre-assembled queue will not pay the cost of assembling the batch.
  
    images, labels = tf.train.batch([image, label], batch_size=32, num_threads=4)
    batch_queue = prefetch_queue([images, labels])
    images, labels = batch_queue.dequeue()
    logits = Net(images)
    loss = Loss(logits, labels)
  
    Args:
      tensors: A list or dictionary of `Tensors` to enqueue in the buffer.
      capacity: An integer. The maximum number of elements in the queue.
      shared_name: (optional). If set, this queue will be shared under the given
        name across multiple sessions.
      name: (Optional) A name for the operations.
  
    Returns:
      A queue from which you can dequeue tensors with the same type and shape
      as `tensors`.
docstring_summary: Creates a queue to prefetech tensors from `tensors`.
docstring_tokens: Creates a queue to prefetech tensors from tensors .
function: def prefetch_queue(tensors,
                     capacity=8,
                     shared_name=None,
                     name=None):
    """Creates a queue to prefetech tensors from `tensors`.
  
    A queue runner for enqueing tensors into the prefetch_queue is automatically
    added to the TF QueueRunners collection.
  
    Example:
    This is for example useful to pre-assemble input batches read with
    `tf.train.batch()` and enqueue the pre-assembled batches.  Ops that dequeue
    from the pre-assembled queue will not pay the cost of assembling the batch.
  
    images, labels = tf.train.batch([image, label], batch_size=32, num_threads=4)
    batch_queue = prefetch_queue([images, labels])
    images, labels = batch_queue.dequeue()
    logits = Net(images)
    loss = Loss(logits, labels)
  
    Args:
      tensors: A list or dictionary of `Tensors` to enqueue in the buffer.
      capacity: An integer. The maximum number of elements in the queue.
      shared_name: (optional). If set, this queue will be shared under the given
        name across multiple sessions.
      name: (Optional) A name for the operations.
  
    Returns:
      A queue from which you can dequeue tensors with the same type and shape
      as `tensors`.
    """
    if isinstance(tensors, dict):
      # Need to wrap the keys and values in list() since Python3 returns views.
      names = list(tensors.keys())
      tensor_list = list(tensors.values())
    else:
      names = None
      tensor_list = tensors
  
    with ops.op_scope(tensor_list, name, "prefetch_queue") as name:
      dtypes = [t.dtype for t in tensor_list]
      shapes = [t.get_shape() for t in tensor_list]
      queue = data_flow_ops.FIFOQueue(capacity=capacity,
                                      dtypes=dtypes,
                                      shapes=shapes,
                                      names=names,
                                      shared_name=shared_name)
      enqueue_op = queue.enqueue(tensors, name=name)
      queue_runner.add_queue_runner(queue_runner.QueueRunner(queue, [enqueue_op]))
      logging_ops.scalar_summary(
          "queue/%s/fraction_of_%d_full" % (queue.name, capacity),
          math_ops.to_float(queue.size()) * (1. / capacity))
      return queue
function_tokens: def prefetch_queue ( tensors , capacity = 8 , shared_name = None , name = None ) : if isinstance ( tensors , dict ) : # Need to wrap the keys and values in list() since Python3 returns views. names = list ( tensors . keys ( ) ) tensor_list = list ( tensors . values ( ) ) else : names = None tensor_list = tensors with ops . op_scope ( tensor_list , name , "prefetch_queue" ) as name : dtypes = [ t . dtype for t in tensor_list ] shapes = [ t . get_shape ( ) for t in tensor_list ] queue = data_flow_ops . FIFOQueue ( capacity = capacity , dtypes = dtypes , shapes = shapes , names = names , shared_name = shared_name ) enqueue_op = queue . enqueue ( tensors , name = name ) queue_runner . add_queue_runner ( queue_runner . QueueRunner ( queue , [ enqueue_op ] ) ) logging_ops . scalar_summary ( "queue/%s/fraction_of_%d_full" % ( queue . name , capacity ) , math_ops . to_float ( queue . size ( ) ) * ( 1. / capacity ) ) return queue