tf.tuple
tf.tuple
tf.tuple
tuple( tensors, name=None, control_inputs=None )
Defined in tensorflow/python/ops/control_flow_ops.py
.
See the guide: Control Flow > Control Flow Operations
Group tensors together.
This creates a tuple of tensors with the same values as the tensors
argument, except that the value of each tensor is only returned after the values of all tensors have been computed.
control_inputs
contains additional ops that have to finish before this op finishes, but whose outputs are not returned.
This can be used as a "join" mechanism for parallel computations: all the argument tensors can be computed in parallel, but the values of any tensor returned by tuple
are only available after all the parallel computations are done.
See also group and control_dependencies.
Args:
-
tensors
: A list ofTensor
s orIndexedSlices
, some entries can beNone
. -
name
: (optional) A name to use as aname_scope
for the operation. -
control_inputs
: List of additional ops to finish before returning.
Returns:
Same as tensors
.
Raises:
-
ValueError
: Iftensors
does not contain anyTensor
orIndexedSlices
. -
TypeError
: Ifcontrol_inputs
is not a list ofOperation
orTensor
objects.
© 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/tuple