docstr: Tests batch shape of spline and interpolation are broadcasted.
docstr_tok: ["Tests","batch","shape","of","spline","and","interpolation","are","broadcasted","."]
code: def test_spline_broadcast_batch(self, optimize_for_tpu):
      """Tests batch shape of spline and interpolation are broadcasted."""
      x_data1 = np.linspace(-5.0, 5.0, num=11)
      x_data2 = np.linspace(0.0, 10.0, num=11)
      x_data = np.array([x_data1, x_data2])
      y_data = 1.0 / (2.0 + x_data**2)
      x_data = tf.stack(x_data, axis=0)
      dtype = np.float64
      x_value_1 = tf.constant([[[-1.2, 0.0, 0.3]]], dtype=dtype)
      x_value_2 = tf.constant([-1.2, 0.0, 0.3], dtype=dtype)
      spline = tff.math.interpolation.cubic.build_spline(x_data, y_data)
  
      result_1 = tff.math.interpolation.cubic.interpolate(
          x_value_1,
          spline,
          optimize_for_tpu=optimize_for_tpu,
          dtype=dtype,
      )
      result_2 = tff.math.interpolation.cubic.interpolate(
          x_value_2,
          spline,
          optimize_for_tpu=optimize_for_tpu,
          dtype=dtype,
      )
      expected_1 = np.array(
          [[[0.29131469, 0.5, 0.4779499], [0.5, 0.5, 0.45159077]]],
          dtype=dtype,
      )
      expected_2 = np.array(
          [[0.29131469, 0.5, 0.4779499], [0.5, 0.5, 0.45159077]],
          dtype=dtype,
      )
      with self.subTest("BroadcastData"):
          self.assertAllClose(result_1, expected_1)
      with self.subTest("BroadcastValues"):
          self.assertAllClose(result_2, expected_2)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math.interpolation import cubic
label_desc: Use image node_id 7 for calling the CubicInterpolationTest obj's underlying member method code with example usage: obj.test_spline_broadcast_batch(optimize_for_tpu) without return types