MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / maybe_shuffle_batch_join

Function maybe_shuffle_batch_join

tensorflow/python/training/input.py:1517–1573  ·  view source on GitHub ↗

Create batches by randomly shuffling conditionally-enqueued tensors. See docstring in `shuffle_batch_join` for more details. Args: tensors_list: A list of tuples or dictionaries of tensors to enqueue. batch_size: An integer. The new batch size pulled from the queue. capacity: An in

(tensors_list, batch_size, capacity,
                             min_after_dequeue, keep_input, seed=None,
                             enqueue_many=False, shapes=None,
                             allow_smaller_final_batch=False, shared_name=None,
                             name=None)

Source from the content-addressed store, hash-verified

1515 "`tf.data.Dataset.interleave(...).filter(...).shuffle(min_after_dequeue)"
1516 ".batch(batch_size)`.")
1517def maybe_shuffle_batch_join(tensors_list, batch_size, capacity,
1518 min_after_dequeue, keep_input, seed=None,
1519 enqueue_many=False, shapes=None,
1520 allow_smaller_final_batch=False, shared_name=None,
1521 name=None):
1522 """Create batches by randomly shuffling conditionally-enqueued tensors.
1523
1524 See docstring in `shuffle_batch_join` for more details.
1525
1526 Args:
1527 tensors_list: A list of tuples or dictionaries of tensors to enqueue.
1528 batch_size: An integer. The new batch size pulled from the queue.
1529 capacity: An integer. The maximum number of elements in the queue.
1530 min_after_dequeue: Minimum number elements in the queue after a
1531 dequeue, used to ensure a level of mixing of elements.
1532 keep_input: A `bool` Tensor. This tensor controls whether the input is
1533 added to the queue or not. If it is a scalar and evaluates `True`, then
1534 `tensors` are all added to the queue. If it is a vector and `enqueue_many`
1535 is `True`, then each example is added to the queue only if the
1536 corresponding value in `keep_input` is `True`. This tensor essentially
1537 acts as a filtering mechanism.
1538 seed: Seed for the random shuffling within the queue.
1539 enqueue_many: Whether each tensor in `tensor_list_list` is a single
1540 example.
1541 shapes: (Optional) The shapes for each example. Defaults to the
1542 inferred shapes for `tensors_list[i]`.
1543 allow_smaller_final_batch: (Optional) Boolean. If `True`, allow the final
1544 batch to be smaller if there are insufficient items left in the queue.
1545 shared_name: (optional). If set, this queue will be shared under the given
1546 name across multiple sessions.
1547 name: (Optional) A name for the operations.
1548
1549 Returns:
1550 A list or dictionary of tensors with the same number and types as
1551 `tensors_list[i]`.
1552
1553 Raises:
1554 ValueError: If the `shapes` are not specified, and cannot be
1555 inferred from the elements of `tensors_list`.
1556
1557 @compatibility(eager)
1558 Input pipelines based on Queues are not supported when eager execution is
1559 enabled. Please use the `tf.data` API to ingest data under eager execution.
1560 @end_compatibility
1561 """
1562 return _shuffle_batch_join(
1563 tensors_list,
1564 batch_size,
1565 capacity,
1566 min_after_dequeue,
1567 keep_input,
1568 seed=seed,
1569 enqueue_many=enqueue_many,
1570 shapes=shapes,
1571 allow_smaller_final_batch=allow_smaller_final_batch,
1572 shared_name=shared_name,
1573 name=name)

Callers

nothing calls this directly

Calls 1

_shuffle_batch_joinFunction · 0.85

Tested by

no test coverage detected