docstr: Tests model with constant parameters in 1 dimension.
docstr_tok: ["Tests","model","with","constant","parameters","in","1","dimension","."]
code: def test_correctness_1d(self, use_analytic_pricing, error_tol):
      """Tests model with constant parameters in 1 dimension."""
      dtype = tf.float64
      expiries = np.array(1.0)
      maturities = np.array(5.0)
      strikes = np.exp(-0.01 * maturities) / np.exp(-0.01 * expiries)
      price = tff.models.hull_white.bond_option_price(
          strikes=strikes,
          expiries=expiries,
          maturities=maturities,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          discount_rate_fn=self.discount_rate_1d_fn,
          use_analytic_pricing=use_analytic_pricing,
          num_samples=500000,
          time_step=0.1,
          random_type=tff.math.random.RandomType.PSEUDO_ANTITHETIC,
          dtype=dtype,
      )
      with self.subTest("DType"):
          self.assertEqual(price.dtype, dtype)
      with self.subTest("Shape"):
          self.assertAllEqual(price.shape, [])
      price = self.evaluate(price)
      with self.subTest("Price"):
          self.assertAllClose(
              price, 0.02817777, rtol=error_tol, atol=error_tol
          )
  
file_path: tf-quant-finance/tf_quant_finance/models/hull_white/zero_coupon_bond_option_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
label_desc: Use image node_id 2 for calling the HullWhiteBondOptionTest obj's underlying member method code with example usage: obj.test_correctness_1d(use_analytic_pricing, error_tol) without return types