code: def foldr_v2(
      fn,
      elems,
      initializer=None,
      parallel_iterations=10,
      back_prop=True,
      swap_memory=False,
      name=None,
  ):
      """foldr on the list of tensors unpacked from `elems` on dimension 0.
  
      This foldr operator repeatedly applies the callable `fn` to a sequence
      of elements from last to first. The elements are made of the tensors
      unpacked from `elems`. The callable fn takes two tensors as arguments.
      The first argument is the accumulated value computed from the preceding
      invocation of fn, and the second is the value at the current position of
      `elems`. If `initializer` is None, `elems` must contain at least one element,
      and its first element is used as the initializer.
  
      Suppose that `elems` is unpacked into `values`, a list of tensors. The shape
      of the result tensor is `fn(initializer, values[0]).shape`.
  
      This method also allows multi-arity `elems` and output of `fn`.  If `elems`
      is a (possibly nested) list or tuple of tensors, then each of these tensors
      must have a matching first (unpack) dimension.  The signature of `fn` may
      match the structure of `elems`.  That is, if `elems` is
      `(t1, [t2, t3, [t4, t5]])`, then an appropriate signature for `fn` is:
      `fn = lambda (t1, [t2, t3, [t4, t5]]):`.
  
      Args:
        fn: The callable to be performed.
        elems: A tensor or (possibly nested) sequence of tensors, each of which will
          be unpacked along their first dimension.  The nested sequence of the
          resulting slices will be the first argument to `fn`.
        initializer: (optional) A tensor or (possibly nested) sequence of tensors,
          as the initial value for the accumulator.
        parallel_iterations: (optional) The number of iterations allowed to run in
          parallel.
        back_prop: (optional) Deprecated. False disables support for back
          propagation. Prefer using `tf.stop_gradient` instead.
        swap_memory: (optional) True enables GPU-CPU memory swapping.
        name: (optional) Name prefix for the returned tensors.
  
      Returns:
        A tensor or (possibly nested) sequence of tensors, resulting from applying
        `fn` consecutively to the list of tensors unpacked from `elems`, from last
        to first.
  
      Raises:
        TypeError: if `fn` is not callable.
  
      Example:
        ```python
        elems = [1, 2, 3, 4, 5, 6]
        sum = tf.foldr(lambda a, x: a + x, elems)
        # sum == 21
        ```
      """
      return foldr(
          fn=fn,
          elems=elems,
          initializer=initializer,
          parallel_iterations=parallel_iterations,
          back_prop=back_prop,
          swap_memory=swap_memory,
          name=name,
      )
  
imports: from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_functional_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import while_loop
  from tensorflow.python.ops.gen_functional_ops import remote_call
  from tensorflow.python.ops.gen_functional_ops import symbolic_gradient
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: foldr_v2(fn, elems, initializer, parallel_iterations, back_prop, swap_memory, name) and returns: foldr