parameters: (*inputs, **kwargs)
docstring: Create an op that groups multiple operations.
  
    When this op finishes, all ops in `inputs` have finished. This op has no
    output.
  
    See also `tf.tuple` and
    `tf.control_dependencies`.
  
    Args:
      *inputs: Zero or more tensors to group.
      name: A name for this operation (optional).
  
    Returns:
      An Operation that executes all its inputs.
  
    Raises:
      ValueError: If an unknown keyword argument is provided.
docstring_summary: Create an op that groups multiple operations.
docstring_tokens: Create an op that groups multiple operations .
function: def group(*inputs, **kwargs):
    """Create an op that groups multiple operations.
  
    When this op finishes, all ops in `inputs` have finished. This op has no
    output.
  
    See also `tf.tuple` and
    `tf.control_dependencies`.
  
    Args:
      *inputs: Zero or more tensors to group.
      name: A name for this operation (optional).
  
    Returns:
      An Operation that executes all its inputs.
  
    Raises:
      ValueError: If an unknown keyword argument is provided.
    """
    if context.executing_eagerly():
      return None
    name = kwargs.pop("name", None)
    if kwargs:
      raise ValueError("Unknown keyword arguments: " + ", ".join(kwargs.keys()))
    with ops.name_scope(name, "group_deps", inputs) as name:
      # Grouping no inputs means do nothing
      if not inputs:
        return no_op(name=name)
  
      # Sorts *inputs according to their devices.
      ops_on_device = {}  # device -> operations specified on the device.
      for inp in nest.flatten(inputs, expand_composites=True):
        if not hasattr(inp, "device"):
          raise TypeError("Expected tf.group() expected Tensor arguments not "
                          "'%s' with type '%s'" % (inp, type(inp)))
        dev = inp.device
        if dev in ops_on_device:
          ops_on_device[dev].append(inp)
        else:
          ops_on_device[dev] = [inp]
      if len(ops_on_device) == 1:
        # 1-level tree. The root node is the returned NoOp node.
        (dev, deps), = ops_on_device.items()
        return _GroupControlDeps(dev, deps, name=name)
  
      # 2-level tree. The root node is the returned NoOp node.
      # deps contains 1 NoOp node for each device.
      deps = []
  
      def device_key(dev):
        """A sort key that allows None to be compared to strings."""
        return "" if dev is None else dev
  
      for dev in sorted(ops_on_device, key=device_key):
        deps.append(_GroupControlDeps(dev, ops_on_device[dev]))
  
      with ops.control_dependencies(deps):
        return no_op(name=name)
function_tokens: def group ( * inputs , * * kwargs ) : if context . executing_eagerly ( ) : return None name = kwargs . pop ( "name" , None ) if kwargs : raise ValueError ( "Unknown keyword arguments: " + ", " . join ( kwargs . keys ( ) ) ) with ops . name_scope ( name , "group_deps" , inputs ) as name : # Grouping no inputs means do nothing if not inputs : return no_op ( name = name ) # Sorts *inputs according to their devices. ops_on_device = { } # device -> operations specified on the device. for inp in nest . flatten ( inputs , expand_composites = True ) : if not hasattr ( inp , "device" ) : raise TypeError ( "Expected tf.group() expected Tensor arguments not " "'%s' with type '%s'" % ( inp , type ( inp ) ) ) dev = inp . device if dev in ops_on_device : ops_on_device [ dev ] . append ( inp ) else : ops_on_device [ dev ] = [ inp ] if len ( ops_on_device ) == 1 : # 1-level tree. The root node is the returned NoOp node. ( dev , deps ) , = ops_on_device . items ( ) return _GroupControlDeps ( dev , deps , name = name ) # 2-level tree. The root node is the returned NoOp node. # deps contains 1 NoOp node for each device. deps = [ ] def device_key ( dev ) : """A sort key that allows None to be compared to strings.""" return "" if dev is None else dev for dev in sorted ( ops_on_device , key = device_key ) : deps . append ( _GroupControlDeps ( dev , ops_on_device [ dev ] ) ) with ops . control_dependencies ( deps ) : return no_op ( name = name )