class_docstr: Tests for Heston Price method.
code: def test_heston_price(self, dtype, use_forwards):
      mean_reversion = np.array([0.1, 10.0], dtype=dtype)
      theta = np.array([0.1, 0.5], dtype=dtype)
      variances = np.array([0.1, 0.5], dtype=dtype)
      discount_factors = np.array([0.99, 0.98], dtype=dtype)
      expiries = np.array([1.0], dtype=dtype)
      forwards = np.array([10.0], dtype=dtype)
      if use_forwards:
          spots = None
      else:
          spots = forwards * discount_factors
          forwards = None
      volvol = np.array([1.0, 0.9], dtype=dtype)
      strikes = np.array([9.7, 10.0], dtype=dtype)
  
      rho = np.array([0.5, 0.1], dtype=dtype)
  
      tff_prices = self.evaluate(
          tff.models.heston.approximations.european_option_price(
              mean_reversion=mean_reversion,
              theta=theta,
              volvol=volvol,
              rho=rho,
              variances=variances,
              forwards=forwards,
              spots=spots,
              expiries=expiries,
              strikes=strikes,
              discount_factors=discount_factors,
              is_call_options=np.asarray([True, False], dtype=bool),
          )
      )
      # Computed using scipy
      scipy_prices = [1.07475678, 2.708217]
      np.testing.assert_allclose(
          tff_prices, scipy_prices, rtol=1e-5, atol=1e-5
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/heston/approximations/european_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 2 for calling the HestonPriceTest obj's underlying member method code with example usage: obj.test_heston_price(dtype, use_forwards) without return types