class_docstr: Test for 1-D usage of tfp.math.interp_regular_1d_grid.
class_docstr_tok: ["Test","for","1-D","usage","of","tfp.math.interp_regular_1d_grid","."]
code: def test_scalar_valued_with_1_batch_dim_x_and_x_minmax_have_empty_batch(
      self,
  ):
      implied_x_ref = tf.linspace(
          np.array(-3.0, dtype=np.float32), 3.2, 200
      )
      y_ref = tf.stack(  # Shape [2, 200]
          [tf.exp(implied_x_ref), tf.exp(2 * implied_x_ref)], axis=0
      )
  
      # x.shape = [3] ==> No batch dim.
      # Values of x will be broadcast so effectively x.shape = [2, 3]
      x = np.array([1.0, 1.12, 2.11], dtype=np.float32)
      y = interpolation.batch_interp_regular_1d_grid(
          x,
          x_ref_min=np.array(-3.0, dtype=np.float32),
          x_ref_max=np.array(3.2, dtype=np.float32),
          y_ref=y_ref,
          axis=-1,
      )
      self.assertAllEqual((2, 3), y.shape)
      y_ = self.evaluate(y)
      self.assertAllClose(np.exp(x), y_[0], rtol=1e-3)
      self.assertAllClose(np.exp(2 * x), y_[1], rtol=1e-3)
  
imports: import numpy
  from scipy import interpolate
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import interpolation
label_desc: Use image node_id 9 for calling the BatchInterpRegular1DGridTest obj's underlying member method code with example usage: obj.test_scalar_valued_with_1_batch_dim_x_and_x_minmax_have_empty_batch() without return types