class_docstr: Tests for methods for the vanilla pricing module.
class_docstr_tok: ["Tests","for","methods","for","the","vanilla","pricing","module","."]
docstr: Function tests barrier option pricing for with given data type.
docstr_tok: ["Function","tests","barrier","option","pricing","for","with","given","data","type","."]
code: def test_barrier_option_dtype(self, dtype):
      """Function tests barrier option pricing for with given data type."""
      spots = 100.0
      rebates = 3.0
      expiries = 0.5
      discount_rates = 0.08
      dividend_rates = 0.04
      strikes = 90.0
      barriers = 95.0
      expected_price = 9.0246
      is_call_options = True
      is_barrier_down = True
      is_knock_out = True
      volatilities = 0.25
      price = tff.black_scholes.barrier_price(
          volatilities=volatilities,
          strikes=strikes,
          expiries=expiries,
          spots=spots,
          discount_rates=discount_rates,
          dividend_rates=dividend_rates,
          barriers=barriers,
          rebates=rebates,
          is_barrier_down=is_barrier_down,
          is_knock_out=is_knock_out,
          is_call_options=is_call_options,
          dtype=dtype,
      )
      self.assertAllClose(price, expected_price, 10e-3)
      self.assertEqual(price.dtype, dtype)
  
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 17 for calling the VanillaPrice obj's underlying member method code with example usage: obj.test_barrier_option_dtype(dtype) without return types