class_docstr: Tests for methods for the american pricing module.
docstr: Tests Bjerksund Stensland 2002 prices for batched inputs.
docstr_tok: ["Tests","Bjerksund","Stensland","2002","prices","for","batched","inputs","."]
code: def test_bs2002_prices_types(self):
      """Tests Bjerksund Stensland 2002 prices for batched inputs."""
      discount_rates = tf.constant([0.10, 0.09, 0.08, 0.07, 0.06, 0.05])
      dividend_rates = tf.constant([0.05, 0.06, 0.07, 0.08, 0.09, 0.10])
      volatilities = tf.constant([0.10, 0.15, 0.20, 0.25, 0.30, 0.35])
      expiries = tf.constant([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])
      spots = tf.constant([90.0, 100.0, 110.0, 90.0, 100.0, 110.0])
      strikes = tf.constant([100.0] * 6)
      is_call_options = tf.constant(
          [True, True, True, False, False, False]
      )
      computed_prices = bjerksund_stensland(
          volatilities=volatilities,
          strikes=strikes,
          expiries=expiries,
          discount_rates=discount_rates,
          dividend_rates=dividend_rates,
          spots=spots,
          is_call_options=is_call_options,
          modified_boundary=True,
      )
      expected_prices = [
          0.0006,
          2.9419,
          11.2353,
          12.2219,
          8.8804,
          7.8527,
      ]
      with self.subTest(name="ExpectedPrices"):
          msg = "Failed: Bjerksund Stensland 2002 type tests."
          self.assertAllClose(
              expected_prices,
              computed_prices,
              rtol=5e-3,
              atol=5e-3,
              msg=msg,
          )
  
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 16 for calling the AmericanPrice obj's underlying member method code with example usage: obj.test_bs2002_prices_types() without return types