| View source on GitHub |
Groups tensors together.
tf.tuple(
tensors, control_inputs=None, name=None
)
The returned tensors have the same value as the input tensors, but they are computed only after all the input tensors have been computed.
Note: In TensorFlow 2 with eager and/or Autograph, you should not require this method, as ops execute in the expected order thanks to automatic control dependencies. Only usetf.tuplewhen working with v1tf.Graphcode.
See also tf.group and tf.control_dependencies.
| Args | |
|---|---|
tensors | A list of Tensors or IndexedSlices, some entries can be None. |
control_inputs | List of additional ops to finish before returning. |
name | (optional) A name to use as a name_scope for the operation. |
| Returns | |
|---|---|
Same as tensors. |
| Raises | |
|---|---|
ValueError | If tensors does not contain any Tensor or IndexedSlices. |
TypeError | If control_inputs is not a list of Operation or Tensor objects. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/tuple