code: def test_prepare_grid_time_step(self, dtype):
      times = tf.constant([0.1, 0.5, 1, 2], dtype=dtype)
      time_step = tf.constant(0.1, dtype=tf.float64)
      grid, _, time_indices = utils.prepare_grid(
          times=times, time_step=time_step, dtype=dtype
      )
      expected_grid = np.linspace(0, 2, 21, dtype=dtype)
      recovered_times = tf.gather(grid, time_indices)
      with self.subTest("Grid"):
          self.assertAllClose(grid, expected_grid, rtol=1e-6, atol=1e-6)
      with self.subTest("Times"):
          self.assertAllClose(
              times, recovered_times, rtol=1e-6, atol=1e-6
          )
  
file_path: tf-quant-finance/tf_quant_finance/models/utils_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.models import utils
label_desc: Use image node_id 5 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_prepare_grid_time_step(dtype) without return types