docstr: Tests model with constant parameters in 1 dimension.
docstr_tok: ["Tests","model","with","constant","parameters","in","1","dimension","."]
code: def test_correctness_with_european(self, dtype, use_fd):
      """Tests model with constant parameters in 1 dimension."""
      # Compare bermudan swaption price with single expiry to the price of
      # european swaption
  
      price_berm = tff.models.hull_white.bermudan_swaption_price(
          exercise_times=[self.exercise_times[0][0]],
          floating_leg_start_times=self.float_leg_start_times[0][0],
          floating_leg_end_times=self.float_leg_end_times[0][0],
          fixed_leg_payment_times=self.fixed_leg_payment_times[0][0],
          floating_leg_daycount_fractions=self.float_leg_daycount_fractions[
              0
          ][
              0
          ],
          fixed_leg_daycount_fractions=self.fixed_leg_daycount_fractions[
              0
          ][
              0
          ],
          fixed_leg_coupon=self.fixed_leg_coupon[0][0],
          reference_rate_fn=self.zero_rate_fn,
          notional=100.0,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          num_samples=50000,
          time_step=0.1,
          random_type=tff.math.random.RandomType.STATELESS_ANTITHETIC,
          seed=[0, 0],
          use_finite_difference=use_fd,
          time_step_finite_difference=0.05,
          num_grid_points_finite_difference=500,
          dtype=dtype,
      )
  
      price_euro = tff.models.hull_white.swaption_price(
          expiries=self.exercise_times[0][0],
          floating_leg_start_times=self.float_leg_start_times[0][0],
          floating_leg_end_times=self.float_leg_end_times[0][0],
          fixed_leg_payment_times=self.fixed_leg_payment_times[0][0],
          floating_leg_daycount_fractions=self.float_leg_daycount_fractions[
              0
          ][
              0
          ],
          fixed_leg_daycount_fractions=self.fixed_leg_daycount_fractions[
              0
          ][
              0
          ],
          fixed_leg_coupon=self.fixed_leg_coupon[0][0],
          reference_rate_fn=self.zero_rate_fn,
          notional=100.0,
          mean_reversion=self.mean_reversion_1d,
          volatility=self.volatility_1d,
          dtype=dtype,
      )
  
      self.assertAllClose(
          self.evaluate(price_berm),
          self.evaluate(price_euro),
          rtol=1e-3,
          atol=1e-3,
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/hull_white/bermudan_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 4 for calling the HullWhiteBermudanSwaptionTest obj's underlying member method code with example usage: obj.test_correctness_with_european(dtype, use_fd) without return types