docstr: Tests model with time dependent vol in 1 dimension.
docstr_tok: ["Tests","model","with","time","dependent","vol","in","1","dimension","."]
code: def test_time_dependent_1d(self, random_type, seed):
      """Tests model with time dependent vol in 1 dimension."""
      for dtype in [tf.float32, tf.float64]:
  
          def discount_fn(x):
              return 0.01 * tf.ones_like(
                  x, dtype=dtype
              )  # pylint: disable=cell-var-from-loop
  
          volatility = tff.math.piecewise.PiecewiseConstantFunc(
              [0.1, 2.0],
              values=self.volatility_time_dep_1d,
              dtype=dtype,
          )
          process = tff.models.hull_white.HullWhiteModel1F(
              mean_reversion=self.mean_reversion[0],
              volatility=volatility,
              initial_discount_rate_fn=discount_fn,
              dtype=dtype,
          )
          times = np.array([0.1, 1.0, 2.0, 3.0])
          paths = process.sample_paths(
              times,
              num_samples=500000,
              random_type=random_type,
              seed=seed,
              skip=1000000,
          )
          self.assertEqual(paths.dtype, dtype)
          self.assertAllEqual(paths.shape, [500000, 4, 1])
          paths = self.evaluate(paths)
          r_std = np.squeeze(np.std(paths, axis=0))
          expected_std = self.true_std_time_dep(
              times,
              np.array([0.0, 0.1, 2.0]),
              np.array(self.volatility_time_dep_1d),
              0.1,
          )
          self.assertAllClose(r_std, expected_std, rtol=1e-4, atol=1e-4)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 4 for calling the HullWhiteTest obj's underlying member method code with example usage: obj.test_time_dependent_1d(random_type, seed) and returns: unknown