docstr: Tests model with XLA.
docstr_tok: ["Tests","model","with","XLA","."]
code: def test_xla(self, use_analytic_pricing, error_tol):
      """Tests model with XLA."""
      dtype = tf.float64
      expiries = np.array([1.0])
      maturities = np.array([5.0])
      strikes = np.exp(-0.01 * maturities) / np.exp(-0.01 * expiries)
  
      @tf.function(jit_compile=True)
      def xla_fn():
          return 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,
          )
  
      price_xla = xla_fn()
      price = self.evaluate(price_xla)
      self.assertAllClose(
          price, [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 3 for calling the HullWhiteBondOptionTest obj's underlying member method code with example usage: obj.test_xla(use_analytic_pricing, error_tol) and returns: tff