docstr: Tests discount bond variance in 1 dimension.
docstr_tok: ["Tests","discount","bond","variance","in","1","dimension","."]
code: def test_variance_zcb_1d(self, random_type, seed):
      """Tests discount bond variance in 1 dimension."""
      dtype = tf.float64
  
      def discount_fn(x):
          return 0.01 * tf.expand_dims(tf.ones_like(x), axis=-1)
  
      mr = 0.03
      vol = 0.015
      mean_reversion = tff.math.piecewise.PiecewiseConstantFunc(
          [], values=[mr], dtype=dtype
      )
      volatility = tff.math.piecewise.PiecewiseConstantFunc(
          [0.1, 2.0], values=3 * [vol], dtype=dtype
      )
      process = tff.models.hull_white.HullWhiteModel1F(
          mean_reversion=mean_reversion,
          volatility=volatility,
          initial_discount_rate_fn=discount_fn,
          dtype=dtype,
      )
      curve_times = np.array([0.0, 1.0, 2.0, 3.0])
      paths, _ = process.sample_discount_curve_paths(
          [0.1, 1.0, 2.0],
          curve_times,
          num_samples=500000,
          random_type=random_type,
          seed=seed,
          skip=1000000,
      )
      with self.subTest("Dtype"):
          self.assertEqual(paths.dtype, dtype)
      with self.subTest("Shape"):
          self.assertAllEqual(paths.shape, [500000, 4, 3, 1])
      paths = self.evaluate(tf.math.log(paths))
      std_zcb = np.std(paths, axis=0)[:, 2, 0]
      expected_std = self.true_zcb_std(2.0, 2.0 + curve_times, vol, mr)
      with self.subTest("VarianceAbsTol"):
          self.assertAllClose(
              std_zcb, 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 3 for calling the HullWhiteTest obj's underlying member method code with example usage: obj.test_variance_zcb_1d(random_type, seed) and returns: unknown