code: def test_prepare_grid_num_time_step(self, dtype):
      num_points = 100
      times = tf.linspace(tf.constant(0.02, dtype=dtype), 1.0, 50)
      time_step = times[-1] / num_points
      grid, _, time_indices = utils.prepare_grid(
          times=times,
          time_step=time_step,
          dtype=dtype,
          num_time_steps=num_points,
      )
      expected_grid = np.linspace(0, 1, 101, dtype=dtype)
      expected_indices = np.array([2 * i for i in range(1, 51)])
      with self.subTest("Grid"):
          self.assertAllClose(grid, expected_grid, rtol=1e-6, atol=1e-6)
      with self.subTest("TimeIndex"):
          self.assertAllClose(
              time_indices, expected_indices, 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 4 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_prepare_grid_num_time_step(dtype) without return types