parameters: (func_graph)
return_statement: return intermediates
docstring: Returns intermediate tensors of `func_graph` for gradient computation.
docstring_summary: Returns intermediate tensors of `func_graph` for gradient computation.
docstring_tokens: Returns intermediate tensors of func_graph for gradient computation .
function: def _get_intermediates(func_graph):
    """Returns intermediate tensors of `func_graph` for gradient computation."""
    intermediates = []
    for op in func_graph.get_operations():
      for t in op.outputs:
        if t in func_graph.inputs: continue
        if t in func_graph.outputs: continue
        if t.dtype is dtypes.resource:
          continue
        # Accumulating mutexes can cause deadlock.
        if op.type == "MutexLock":
          continue
        intermediates.append(t)
    return intermediates
function_tokens: def _get_intermediates ( func_graph ) : intermediates = [ ] for op in func_graph . get_operations ( ) : for t in op . outputs : if t in func_graph . inputs : continue if t in func_graph . outputs : continue if t . dtype is dtypes . resource : continue # Accumulating mutexes can cause deadlock. if op . type == "MutexLock" : continue intermediates . append ( t ) return intermediates