code: def right_mult_by_jacobian_mat(
      jacobian_fn_mat, ode_fn_vec, time, state_vec, vec
  ):
      """Right multiplies a vector by the Jacobian.
  
      The Jacobian is constructed by calling `jacobian_fn_mat(time, state_vec)` if
      doing so does not require automatic differentiation. Otherwise, chain rule
      automatic differentiation is applied to `ode_fn_vec` to obtain the Jacobian.
  
      Args:
        jacobian_fn_mat: Result of `get_jacobian_fn_mat`.
        ode_fn_vec: Result of `get_ode_fn_vec`.
        time: Scalar float `Tensor` time at which to evalute the Jacobian.
        state_vec: `Tensor` state at which to evaluate the Jacobian.
        vec: `Tensor` with shape is compatible with the Jacobian.
  
      Returns:
        `Tensor` representing the dot product.
      """
      if isinstance(jacobian_fn_mat, _AutomaticJacobian):
          # Compute the dot product by using chain rule automatic differentiation.
          _, dot_product = tfp_gradient.value_and_gradient(
              lambda x: ode_fn_vec(time, x),
              state_vec,
              output_gradients=vec,
          )
      else:
          # Compute the dot product by explicitly constructing the Jacobian matrix.
          jacobian_mat = jacobian_fn_mat(time, state_vec)
          dot_product = tf.reshape(
              tf.matmul(vec[tf.newaxis, :], jacobian_mat), [-1]
          )
      return dot_product
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import gradient
  from tensorflow.python.util import nest
label_desc: Use image node_id 13 for calling a global function with example usage: right_mult_by_jacobian_mat(jacobian_fn_mat, ode_fn_vec, time, state_vec, vec) and returns: dot_product