docstr: Tests a spline where there are x_points of the same value.
docstr_tok: ["Tests","a","spline","where","there","are","x_points","of","the","same","value","."]
code: def test_duplicate_x_points(self, optimize_for_tpu):
      """Tests a spline where there are x_points of the same value."""
      # Repeated boundary values are allowed
      x_data = np.array(
          [
              [1.0, 1.0, 2.0, 3.0, 4.0, 4.0, 4.0],
              [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0],
          ]
      )
      y_data = np.array(
          [
              [3.0, 3.0, 1.0, 3.0, 2.0, 2.0, 2.0],
              [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0],
          ]
      )
      spline = tff.math.interpolation.cubic.build_spline(x_data, y_data)
      x_values = np.array(
          [
              [0.0, 1.0, 1.5, 2.0, 2.5, 3.5, 4.0, 5.0],
              [0.0, 1.0, 1.5, 2.0, 2.5, 3.5, 4.0, 5.0],
          ]
      )
      interpolated = tff.math.interpolation.cubic.interpolate(
          x_values, spline, optimize_for_tpu=optimize_for_tpu
      )
      expected = np.array(
          [
              [3.0, 3.0, 1.525, 1.0, 1.925, 2.9, 2.0, 2.0],
              [1.0, 1.0, 1.5, 2.0, 2.5, 3.5, 4.0, 5.0],
          ]
      )
      interpolated = self.evaluate(interpolated)
      np.testing.assert_almost_equal(expected, interpolated)
  
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 9 for calling the CubicInterpolationTest obj's underlying member method code with example usage: obj.test_duplicate_x_points(optimize_for_tpu) without return types