class_docstr: Tests for methods for the american pricing module.
docstr: Tests Baron-Adesi Whaley prices with zero discount.
docstr_tok: ["Tests","Baron-Adesi","Whaley","prices","with","zero","discount","."]
code: def test_option_prices_zero_discount_rates(self):
      """Tests Baron-Adesi Whaley prices with zero discount."""
      dtype = tf.float64
      computed_prices, converged, failed = adesi_whaley(
          volatilities=[0.2],
          strikes=[104, 90],
          expiries=[0.1, 1.0],
          spots=[100],
          tolerance=1e-08,
          is_call_options=[True, False],
          discount_rates=[0.0, 0.0],
          dtype=dtype,
      )
      # Computed using tff.black_scholes.option_price_binomial
      expected_prices = [1.05226366, 3.58957787]
      with self.subTest(name="ExpectedPrices"):
          self.assertAllClose(
              expected_prices, computed_prices, rtol=1e-4, atol=5e-4
          )
      with self.subTest(name="AllConverged"):
          self.assertAllEqual(converged, tf.ones_like(computed_prices))
      with self.subTest(name="NonFailed"):
          self.assertAllEqual(failed, tf.zeros_like(computed_prices))
  
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 5 for calling the AmericanPrice obj's underlying member method code with example usage: obj.test_option_prices_zero_discount_rates() without return types