Rebatch a tensor. 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. If false, th
(labeled_tensors,
batch_size,
num_threads=1,
capacity=32,
enqueue_many=False,
allow_smaller_final_batch=False,
name=None)
| 451 | tc.Collection(core.LabeledTensorLike), int, int, int, bool, bool, |
| 452 | tc.Optional(string_types)) |
| 453 | def batch(labeled_tensors, |
| 454 | batch_size, |
| 455 | num_threads=1, |
| 456 | capacity=32, |
| 457 | enqueue_many=False, |
| 458 | allow_smaller_final_batch=False, |
| 459 | name=None): |
| 460 | """Rebatch a tensor. |
| 461 | |
| 462 | See tf.batch. |
| 463 | |
| 464 | Args: |
| 465 | labeled_tensors: The input tensors. |
| 466 | batch_size: The output batch size. |
| 467 | num_threads: See tf.batch. |
| 468 | capacity: See tf.batch. |
| 469 | enqueue_many: If true, the input tensors must contain a 'batch' axis as |
| 470 | their first axis. |
| 471 | If false, the input tensors must not contain a 'batch' axis. |
| 472 | See tf.batch. |
| 473 | allow_smaller_final_batch: See tf.batch. |
| 474 | name: Optional op name. |
| 475 | |
| 476 | Returns: |
| 477 | The rebatched tensors. |
| 478 | If enqueue_many is false, the output tensors will have a new 'batch' axis |
| 479 | as their first axis. |
| 480 | |
| 481 | Raises: |
| 482 | ValueError: If enqueue_many is True and the first axis of the tensors |
| 483 | isn't "batch". |
| 484 | """ |
| 485 | |
| 486 | def fn(tensors, scope): |
| 487 | return input.batch( |
| 488 | tensors, |
| 489 | batch_size=batch_size, |
| 490 | num_threads=num_threads, |
| 491 | capacity=capacity, |
| 492 | enqueue_many=enqueue_many, |
| 493 | allow_smaller_final_batch=allow_smaller_final_batch, |
| 494 | name=scope) |
| 495 | |
| 496 | return _batch_helper('lt_batch', fn, batch_size, enqueue_many, |
| 497 | labeled_tensors, allow_smaller_final_batch, name) |
| 498 | |
| 499 | |
| 500 | @tc.returns(tc.List(core.LabeledTensor)) |
nothing calls this directly
no test coverage detected