docstr: Tests 2-d batch.
docstr_tok: ["Tests","2-d","batch","."]
code: def test_2d_batch(self, use_analytic_pricing, error_tol):
      """Tests 2-d batch."""
      dtype = tf.float64
  
      price = tff.models.hull_white.swaption_price(
          expiries=self.expiries_2d,
          floating_leg_start_times=self.float_leg_start_times_2d,
          floating_leg_end_times=self.float_leg_end_times_2d,
          fixed_leg_payment_times=self.fixed_leg_payment_times_2d,
          floating_leg_daycount_fractions=self.float_leg_daycount_fractions_2d,
          fixed_leg_daycount_fractions=self.fixed_leg_daycount_fractions_2d,
          fixed_leg_coupon=self.fixed_leg_coupon_2d,
          reference_rate_fn=self.zero_rate_fn,
          notional=100.0,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          use_analytic_pricing=use_analytic_pricing,
          num_samples=500000,
          time_step=0.1,
          random_type=tff.math.random.RandomType.STATELESS_ANTITHETIC,
          seed=[4, 2],
          dtype=dtype,
      )
      self.assertEqual(price.dtype, dtype)
      self.assertAllEqual(price.shape, [2, 2])
      price = self.evaluate(price)
      expected = [[1.02849462, 0.22811866], [0.71632434, 0.48142959]]
      self.assertAllClose(
          price, expected, rtol=error_tol, atol=error_tol
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/hull_white/swaption_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 7 for calling the HullWhiteSwaptionTest obj's underlying member method code with example usage: obj.test_2d_batch(use_analytic_pricing, error_tol) without return types