docstr: Tests model with 1d batch of options.
docstr_tok: ["Tests","model","with","1d","batch","of","options","."]
code: def test_1d_batch(self, use_analytic_pricing, error_tol):
      """Tests model with 1d batch of options."""
      dtype = tf.float64
      expiries = np.array([self.expiries, self.expiries, self.expiries])
      maturities = np.array(
          [self.maturities, self.maturities, self.maturities]
      )
      strikes = np.array(
          [self.strikes, 0.01 + self.strikes, 0.02 + self.strikes]
      )
      daycount_fractions = np.array(
          [
              self.daycount_fractions,
              self.daycount_fractions,
              self.daycount_fractions,
          ]
      )
      price = tff.models.hull_white.cap_floor_price(
          strikes=strikes,
          expiries=expiries,
          maturities=maturities,
          daycount_fractions=daycount_fractions,
          notional=100.0,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          reference_rate_fn=self.discount_rate_1d_fn,
          use_analytic_pricing=use_analytic_pricing,
          num_samples=50_000,
          time_step=0.1,
          random_type=tff.math.random.RandomType.STATELESS_ANTITHETIC,
          seed=[42, 42],
          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.40720883, 0.14283513, 0.03980642],
              rtol=error_tol,
              atol=error_tol,
          )
  
file_path: tf-quant-finance/tf_quant_finance/models/hull_white/cap_floor_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 HullWhiteCapFloorTest obj's underlying member method code with example usage: obj.test_1d_batch(use_analytic_pricing, error_tol) without return types