code: def _initialize_accumulated_quantities(
      initial_kalman_filter_state,
      observations,
      num_timesteps,
  ):
      """Initialize quantities to accumulate, specifying dtype/shape."""
      initial_arrays = []
      for x in initial_kalman_filter_state:
          # pylint: disable=cell-var-from-loop
          initial_arrays.append(
              tf.nest.map_structure(
                  lambda _: tf.TensorArray(  # pylint: disable=g-long-lambda
                      dtype=x.dtype,
                      element_shape=x.shape,
                      size=num_timesteps,
                  ),
                  observations,
              )
          )
          # pylint: enable=cell-var-from-loop
      return linear_gaussian_ssm.KalmanFilterState(*initial_arrays)
  
file_path: probability/tensorflow_probability/python/experimental/sequential/extended_kalman_filter.py
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import linalg
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: _initialize_accumulated_quantities(initial_kalman_filter_state, observations, num_timesteps) and returns: linear_gaussian_ssm