[ Web Proxy ]
URL:
Viewing: https://www.tensorflow.org/api_docs/python/tf/group [Back]  [Original]

tf.group  |  TensorFlow v2.16.1 Skip to main content
TensorFlow [TensorFlow]

tf.group Stay organized with collections Save and categorize content based on your preferences.

Create an op that groups multiple operations.

View aliases

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.group

Used in the notebooks

Used in the guide Used in the tutorials

When this op finishes, all ops in inputs have finished. This op has no output.

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 use tf.group when working with v1 tf.Graph code.

When operating in a v1-style graph context, ops are not executed in the same order as specified in the code; TensorFlow will attempt to execute ops in parallel or in an order convenient to the result it is computing. tf.group allows you to request that one or more results finish before execution continues.

tf.group creates a single op (of type NoOp), and then adds appropriate control dependencies. Thus, c = tf.group(a, b) will compute the same graph as this:

with tf.control_dependencies([a, b]):
    c = tf.no_op()

See also tf.tuple and tf.control_dependencies.

*inputs Zero or more tensors to group.
name A name for this operation (optional).

An Operation that executes all its inputs.

ValueError If an unknown keyword argument is provided.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page