code: def testBasic(self):
      def _loop_fn(state, element):
          return state + element
  
      def _trace_fn(state):
          return [state, state * 2]
  
      final_state, trace = loop_util.trace_scan(
          loop_fn=_loop_fn,
          initial_state=0,
          elems=[1, 2],
          trace_fn=_trace_fn,
      )
  
      self.assertAllClose(
          [], tensorshape_util.as_list(final_state.shape)
      )
      self.assertAllClose([2], tensorshape_util.as_list(trace[0].shape))
      self.assertAllClose([2], tensorshape_util.as_list(trace[1].shape))
  
      final_state, trace = self.evaluate([final_state, trace])
  
      self.assertAllClose(3, final_state)
      self.assertAllClose([1, 3], trace[0])
      self.assertAllClose([2, 6], trace[1])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import loop_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 1 for calling the TraceScanTest obj's underlying member method code with example usage: obj.testBasic() and returns: unknown, list