docstr: Tests model with rank 1 batch of options.
docstr_tok: ["Tests","model","with","rank","1","batch","of","options","."]
code: def test_batch(self, use_analytic_pricing, error_tol):
      """Tests model with rank 1 batch of options."""
      dtype = tf.float64
      expiries = np.array([1.0, 1.0, 1.0])
      maturities = np.array([5.0, 5.0, 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, [3])
      price = self.evaluate(price)
      with self.subTest("Prices"):
          self.assertAllClose(
              price,
              [0.02817777, 0.02817777, 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 5 for calling the HullWhiteBondOptionTest obj's underlying member method code with example usage: obj.test_batch(use_analytic_pricing, error_tol) without return types