W3cubDocs

/TensorFlow Python

tf.train.maybe_batch_join(tensors_list, keep_input, batch_size, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None)

tf.train.maybe_batch_join(tensors_list, keep_input, batch_size, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None)

See the guide: Inputs and Readers > Input pipeline

Runs a list of tensors to conditionally fill a queue to create batches.

See docstring in batch_join for more details.

Args:

  • tensors_list: A list of tuples or dictionaries of tensors to enqueue.
  • keep_input: A bool scalar Tensor. This tensor controls whether the input is added to the queue or not. If it evaluates True, then tensors are added to the queue; otherwise they are dropped. This tensor essentially acts as a filtering mechanism.
  • batch_size: An integer. The new batch size pulled from the queue.
  • capacity: An integer. The maximum number of elements in the queue.
  • enqueue_many: Whether each tensor in tensor_list_list is a single example.
  • shapes: (Optional) The shapes for each example. Defaults to the inferred shapes for tensor_list_list[i].
  • dynamic_pad: Boolean. Allow variable dimensions in input shapes. The given dimensions are padded upon dequeue so that tensors within a batch have the same shapes.
  • allow_smaller_final_batch: (Optional) Boolean. If True, allow the final batch to be smaller if there are insufficient items left 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 list or dictionary of tensors with the same number and types as tensors_list[i].

Raises:

  • ValueError: If the shapes are not specified, and cannot be inferred from the elements of tensor_list_list.

Defined in tensorflow/python/training/input.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/train/maybe_batch_join