code: def _get_accumulator(tensor):
      r"""Returns TensorList if any containing accumulated values of tensor.
  
      We try to find a pattern of the form:
  
         input_tl   tensor
            \        /
        (TensorListPushBack)
                |
            output_tl
  
      which satisfies the following conditions:
  
      1. input_tl must be in tensor.graph.inputs.
      2. output_tl or Identity(output_tl) must be in tensor.graph.outputs.
      3. tensor.graph.input_index(input_tl) == tensor.graph.output_index(output_t).
  
      output_tl or Identity(output_tl) (whichever is in tensor.graph.outputs) is
      returned if such a pattern is found else None is returned.
  
      Args:
        tensor: The Tensor to be accumulated.
  
      Returns:
        A variant tensor in the same graph as `tensor` or None if no accumulator is
        found.
      """
      assert isinstance(tensor.graph, func_graph_module.FuncGraph)
  
      def get_func_graph_output(t):
          """Returns t or Identity(t) whichever exists in graph outputs else None."""
          for output in tensor.graph.outputs:
              if output is t:
                  return t
          # tf.defun adds an Identity for each output, check whether that is the case.
          identity_op = t.consumers()[0]
          if identity_op.type == "Identity" and any(
              identity_op.outputs[0] is t for t in tensor.graph.outputs
          ):
              return identity_op.outputs[0]
          return None
  
      for consumer in tensor.consumers():
          # Find the consumer that is a TensorListPushBack node whose TensorList input
          # is in the list of function inputs.
          if consumer.type != "TensorListPushBack":
              continue
  
          accum_input_idx = -1
          for accum_input_idx, inp in enumerate(tensor.graph.inputs):
              if inp is consumer.inputs[0]:
                  break
          else:
              continue
  
          output = get_func_graph_output(consumer.outputs[0])
          if output is None:
              # The TensorList output of `consumer` is not in the list of function
              # outputs.
              continue
  
          for accum_output_idx, out in enumerate(tensor.graph.outputs):
              if out is output:
                  if accum_input_idx == accum_output_idx:
                      return output
                  break
  
      return None
  
imports: import collections
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.eager import backprop_util
  from tensorflow.python.framework import auto_control_deps_utils
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import control_flow_util_v2
  from tensorflow.python.ops import default_gradient
  from tensorflow.python.ops import gen_functional_ops
  from tensorflow.python.ops import gen_resource_variable_ops
  from tensorflow.python.ops import gradients_util
  from tensorflow.python.ops import handle_data_util
  from tensorflow.python.ops import list_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import while_v2_indexed_slices_rewriter
  from tensorflow.python.util import compat
  from tensorflow.python.util import nest
  from tensorflow.python.util import object_identity
  from tensorflow.python.util import variable_utils
label_desc: Use image node_id 13 for calling a global function with example usage: _get_accumulator(tensor) and returns: None, None, identity_op, t, output