class_docstr: Tests for methods for the vanilla pricing module.
class_docstr_tok: ["Tests","for","methods","for","the","vanilla","pricing","module","."]
docstr: Tests that the BS binary option prices are correct.
docstr_tok: ["Tests","that","the","BS","binary","option","prices","are","correct","."]
code: def test_binary_prices(self):
      """Tests that the BS binary option prices are correct."""
      forwards = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
      strikes = np.array([3.0, 3.0, 3.0, 3.0, 3.0])
      volatilities = np.array([0.0001, 102.0, 2.0, 0.1, 0.4])
      expiries = 1.0
      computed_prices = self.evaluate(
          tff.black_scholes.binary_price(
              volatilities=volatilities,
              strikes=strikes,
              expiries=expiries,
              forwards=forwards,
          )
      )
      expected_prices = np.array(
          [0.0, 0.0, 0.15865525, 0.99764937, 0.85927418]
      )
      self.assertArrayNear(expected_prices, computed_prices, 1e-8)
  
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 9 for calling the VanillaPrice obj's underlying member method code with example usage: obj.test_binary_prices() without return types