docstr: Tests model with 1d batch of options.
docstr_tok: ["Tests","model","with","1d","batch","of","options","."]
code: def test_1d_batch(self):
      """Tests model with 1d batch of options."""
      error_tol = 1e-3
      dtype = tf.float64
  
      discount_rate_fn = lambda x: 0.01 * tf.ones_like(x, dtype=dtype)
      expiries = np.array([self.expiries, self.expiries, self.expiries])
      maturities = np.array(
          [self.maturities, self.maturities, self.maturities]
      )
      strikes = np.array([self.strikes, self.strikes, self.strikes])
      daycount_fractions = np.array(
          [
              self.daycount_fractions,
              self.daycount_fractions,
              self.daycount_fractions,
          ]
      )
      price = tff.models.hjm.cap_floor_price(
          strikes=strikes,
          expiries=expiries,
          maturities=maturities,
          daycount_fractions=daycount_fractions,
          notional=100.0,
          dim=1,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          reference_rate_fn=discount_rate_fn,
          num_samples=100000,
          time_step=0.1,
          random_type=tff.math.random.RandomType.STATELESS_ANTITHETIC,
          seed=[42, 42],
          dtype=dtype,
      )
      self.assertEqual(price.dtype, dtype)
      self.assertAllEqual(price.shape, [3])
      price = self.evaluate(price)
      self.assertAllClose(
          price,
          [0.4072088281493774, 0.4072088281493774, 0.4072088281493774],
          rtol=error_tol,
          atol=error_tol,
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/hjm/cap_floor_test.py
imports: 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 HJMCapFloorTest obj's underlying member method code with example usage: obj.test_1d_batch() without return types