Rebatch a tensor, with shuffling. See tf.batch. Args: labeled_tensors: The input tensors. batch_size: The output batch size. num_threads: See tf.batch. capacity: See tf.batch. enqueue_many: If true, the input tensors must contain a 'batch' axis as their first axis.
(labeled_tensors,
batch_size,
num_threads=1,
capacity=32,
enqueue_many=False,
min_after_dequeue=0,
seed=None,
allow_smaller_final_batch=False,
name=None)
| 502 | tc.Collection(core.LabeledTensorLike), int, int, int, bool, int, |
| 503 | tc.Optional(int), bool, tc.Optional(string_types)) |
| 504 | def shuffle_batch(labeled_tensors, |
| 505 | batch_size, |
| 506 | num_threads=1, |
| 507 | capacity=32, |
| 508 | enqueue_many=False, |
| 509 | min_after_dequeue=0, |
| 510 | seed=None, |
| 511 | allow_smaller_final_batch=False, |
| 512 | name=None): |
| 513 | """Rebatch a tensor, with shuffling. |
| 514 | |
| 515 | See tf.batch. |
| 516 | |
| 517 | Args: |
| 518 | labeled_tensors: The input tensors. |
| 519 | batch_size: The output batch size. |
| 520 | num_threads: See tf.batch. |
| 521 | capacity: See tf.batch. |
| 522 | enqueue_many: If true, the input tensors must contain a 'batch' axis as |
| 523 | their first axis. |
| 524 | If false, the input tensors must not contain a 'batch' axis. |
| 525 | See tf.batch. |
| 526 | min_after_dequeue: Minimum number of elements in the queue after a dequeue, |
| 527 | used to ensure mixing. |
| 528 | seed: Optional random seed. |
| 529 | allow_smaller_final_batch: See tf.batch. |
| 530 | name: Optional op name. |
| 531 | |
| 532 | Returns: |
| 533 | The rebatched tensors. |
| 534 | If enqueue_many is false, the output tensors will have a new 'batch' axis |
| 535 | as their first axis. |
| 536 | |
| 537 | Raises: |
| 538 | ValueError: If enqueue_many is True and the first axis of the tensors |
| 539 | isn't "batch". |
| 540 | """ |
| 541 | |
| 542 | def fn(tensors, scope): |
| 543 | return input.shuffle_batch( |
| 544 | tensors, |
| 545 | batch_size=batch_size, |
| 546 | num_threads=num_threads, |
| 547 | capacity=capacity, |
| 548 | enqueue_many=enqueue_many, |
| 549 | min_after_dequeue=min_after_dequeue, |
| 550 | seed=seed, |
| 551 | allow_smaller_final_batch=allow_smaller_final_batch, |
| 552 | name=scope) |
| 553 | |
| 554 | return _batch_helper('lt_shuffle_batch', fn, batch_size, enqueue_many, |
| 555 | labeled_tensors, allow_smaller_final_batch, name) |
| 556 | |
| 557 | |
| 558 | @tc.returns(core.LabeledTensor) |
nothing calls this directly
no test coverage detected