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_on_1d_array_log_spaced_grid(self):
      x_min = 1.0
      x_max = 100000.0
      num_pts = 10
  
      # With only 10 interpolating points between x_ref = 1 and 100000,
      # and y_ref = log(x_ref), we better use a log-spaced grid, or else error
      # will be very bad.
      implied_x_ref = tf.exp(
          tf.linspace(tf.math.log(x_min), tf.math.log(x_max), num_pts)
      )
      y_ref = tf.math.log(implied_x_ref)
  
      x = tf.linspace(x_min + 0.123, x_max, 20)
      y_expected = tf.math.log(x)
  
      y = interpolation.batch_interp_regular_1d_grid(
          x,
          x_min,
          x_max,
          y_ref,
          grid_regularizing_transform=tf.math.log,
      )
      self.assertAllEqual(y_expected.shape, y.shape)
      y_ = self.evaluate(y)
      # Super duper accuracy!  Note accuracy was not good if I did not use the
      # grid_regularizing_transform.
      self.assertAllClose(y_, y_expected, atol=0, rtol=1e-6)
  
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 6 for calling the BatchInterpRegular1DGridTest obj's underlying member method code with example usage: obj.test_on_1d_array_log_spaced_grid() without return types