code: def test_weighted_sum_nested_values(self, dtype):
      del dtype  # not used in this test case.
      weights = [0.5, -0.25, -0.25]
      states = [(tf.eye(2), tf.ones((2, 2))) for _ in range(3)]
      weighted_state_sum = rk_util.weighted_sum(weights, states)
      expected_result = (tf.zeros((2, 2)), tf.zeros((2, 2)))
      self.assertAllCloseNested(weighted_state_sum, expected_result)
  
      weights = [0.5, -0.25, -0.25, 0]
      states = [(tf.eye(2), tf.ones((2, 2))) for _ in range(4)]
      weighted_state_sum = rk_util.weighted_sum(weights, states)
      expected_result = (tf.zeros((2, 2)), tf.zeros((2, 2)))
      self.assertAllCloseNested(weighted_state_sum, expected_result)
  
file_path: probability/tensorflow_probability/python/math/ode/runge_kutta_util_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.ode import runge_kutta_util
label_desc: Use image node_id 4 for calling the RungeKuttaUtilTest obj's underlying member method code with example usage: obj.test_weighted_sum_nested_values(dtype) without return types