class_docstr: Tests for methods for the vanilla pricing module.
class_docstr_tok: ["Tests","for","methods","for","the","vanilla","pricing","module","."]
docstr: Tests the prices with discount_rates.
docstr_tok: ["Tests","the","prices","with","discount_rates","."]
code: def test_option_prices_detailed_discount(self, dtype):
      """Tests the prices with discount_rates."""
      spots = np.array([80.0, 90.0, 100.0, 110.0, 120.0] * 2)
      strikes = np.array([100.0] * 10)
      discount_rates = 0.08
      volatilities = 0.2
      expiries = 0.25
  
      is_call_options = np.array([True] * 5 + [False] * 5)
      dividend_rates = 0.12
      computed_prices = self.evaluate(
          tff.black_scholes.option_price(
              volatilities=volatilities,
              strikes=strikes,
              expiries=expiries,
              spots=spots,
              discount_rates=discount_rates,
              dividend_rates=dividend_rates,
              is_call_options=is_call_options,
              dtype=dtype,
          )
      )
      expected_prices = np.array(
          [
              0.03,
              0.57,
              3.42,
              9.85,
              18.62,
              20.41,
              11.25,
              4.40,
              1.12,
              0.18,
          ]
      )
      self.assertArrayNear(expected_prices, computed_prices, 5e-3)
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 8 for calling the VanillaPrice obj's underlying member method code with example usage: obj.test_option_prices_detailed_discount(dtype) without return types