code: def _create_pde_time_grid(
      exercise_times, time_step_fd, num_time_steps_fd, dtype
  ):
      """Create PDE time grid."""
      with tf.name_scope("create_pde_time_grid"):
          exercise_times, _ = tf.unique(
              tf.reshape(exercise_times, shape=[-1])
          )
          if num_time_steps_fd is not None:
              num_time_steps_fd = tf.convert_to_tensor(
                  num_time_steps_fd,
                  dtype=tf.int32,
                  name="num_time_steps_fd",
              )
              time_step_fd = tf.math.reduce_max(
                  exercise_times
              ) / tf.cast(num_time_steps_fd, dtype=dtype)
          if time_step_fd is None and num_time_steps_fd is None:
              num_time_steps_fd = 100
  
          pde_time_grid, _, _ = utils.prepare_grid(
              times=exercise_times,
              time_step=time_step_fd,
              dtype=dtype,
              num_time_steps=num_time_steps_fd,
          )
          pde_time_grid_dt = pde_time_grid[1:] - pde_time_grid[:-1]
          pde_time_grid_dt = tf.concat(
              [[100.0], pde_time_grid_dt], axis=-1
          )
  
          return pde_time_grid, pde_time_grid_dt
  
file_path: tf-quant-finance/tf_quant_finance/models/hjm/swaption_pricing.py
imports: from typing import Callable, Union
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance.math import pde
  from tf_quant_finance.math import random
  from tf_quant_finance.models import utils
  from tf_quant_finance.models import valuation_method
  from tf_quant_finance.models.hjm import gaussian_hjm
  from tf_quant_finance.models.hjm import quasi_gaussian_hjm
  from tf_quant_finance.models.hjm import swaption_util
label_desc: Use image node_id 5 for calling a global function with example usage: _create_pde_time_grid(exercise_times, time_step_fd, num_time_steps_fd, dtype) and returns: pde_time_grid,  pde_time_grid_dt