code: def update_backward_differences(
      backward_differences,
      next_backward_difference,
      next_state_vec,
      order,
  ):
      """Returns the backward differences for the next time."""
      backward_differences_array = tf.TensorArray(
          backward_differences.dtype,
          size=MAX_ORDER + 3,
          clear_after_read=False,
          element_shape=next_backward_difference.shape,
      ).unstack(backward_differences)
      new_backward_differences_array = tf.TensorArray(
          backward_differences.dtype,
          size=MAX_ORDER + 3,
          clear_after_read=False,
          element_shape=next_backward_difference.shape,
      )
      new_backward_differences_array = (
          new_backward_differences_array.write(
              order + 2,
              next_backward_difference
              - backward_differences_array.read(order + 1),
          )
      )
      new_backward_differences_array = (
          new_backward_differences_array.write(
              order + 1, next_backward_difference
          )
      )
  
      def body(k, new_backward_differences_array_):
          new_backward_differences_array_k = (
              new_backward_differences_array_.read(k + 1)
              + backward_differences_array.read(k)
          )
          new_backward_differences_array_ = (
              new_backward_differences_array_.write(
                  k, new_backward_differences_array_k
              )
          )
          return k - 1, new_backward_differences_array_
  
      _, new_backward_differences_array = tf.while_loop(
          lambda k, new_backward_differences_array: k > 0,
          body,
          [order, new_backward_differences_array],
      )
      new_backward_differences_array = (
          new_backward_differences_array.write(0, next_state_vec)
      )
      new_backward_differences = new_backward_differences_array.stack()
      tensorshape_util.set_shape(
          new_backward_differences,
          tf.TensorShape([MAX_ORDER + 3, None]),
      )
      return new_backward_differences
  
file_path: probability/tensorflow_probability/python/math/ode/bdf_util.py
imports: import collections
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 7 for calling a global function with example usage: update_backward_differences(backward_differences, next_backward_difference, next_state_vec, order) and returns: new_backward_differences, unknown,  new_backward_differences_array_