class_docstr: Tests for methods in linear_interpolation module.
docstr: Tests linear interpolation with const extrapolation and batching.
docstr_tok: ["Tests","linear","interpolation","with","const","extrapolation","and","batching","."]
code: def test_linear_interpolation_const_extrapolation_batching(
      self, optimize_for_tpu
  ):
      """Tests linear interpolation with const extrapolation and batching."""
      x = [[0, 1.5, 4], [4, 5.5, 8]]
      x_data = [[1, 2, 3], [5, 6, 7]]
      y_data = [[0, 2, 4], [1, 2, 3]]
      result = self.evaluate(
          tff.math.interpolation.linear.interpolate(
              x,
              x_data,
              y_data,
              optimize_for_tpu=optimize_for_tpu,
              dtype=tf.float32,
          )
      )
      self.assertAllClose(
          result, np.array([[0, 1, 4], [1, 1.5, 3]]), 1e-8
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 7 for calling the LinearInterpolation obj's underlying member method code with example usage: obj.test_linear_interpolation_const_extrapolation_batching(optimize_for_tpu) without return types