class_docstr: Tests for SABR approximations to implied volatility.
class_docstr_tok: ["Tests","for","SABR","approximations","to","implied","volatility","."]
code: def test_european_option_shifted_sabr(self, volatility_type):
      shift = np.array([1.0, 0.5])
  
      actual_prices = (
          tff.models.sabr.approximations.european_option_price(
              forwards=np.array([-0.5, 0.0]),
              strikes=np.array([1.0, 1.5]),
              expiries=np.array([0.5, 1.0]),
              is_call_options=np.array([True, False]),
              alpha=3.2,
              beta=0.2,
              volvol=1.4,
              rho=0.0005,
              shift=shift,
              volatility_type=volatility_type,
              dtype=tf.float64,
          )
      )
  
      expected_prices = (
          tff.models.sabr.approximations.european_option_price(
              forwards=np.array([-0.5 + shift[0], 0.0 + shift[1]]),
              strikes=np.array([1.0 + shift[0], 1.5 + shift[1]]),
              expiries=np.array([0.5, 1.0]),
              is_call_options=np.array([True, False]),
              alpha=3.2,
              beta=0.2,
              volvol=1.4,
              rho=0.0005,
              volatility_type=volatility_type,
              dtype=tf.float64,
          )
      )
  
      actual_prices, expected_prices = self.evaluate(
          [actual_prices, expected_prices]
      )
      self.assertAllClose(actual_prices, expected_prices)
  
file_path: tf-quant-finance/tf_quant_finance/models/sabr/approximations/european_options_test.py
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 4 for calling the SabrApproximationEuropeanOptionsTest obj's underlying member method code with example usage: obj.test_european_option_shifted_sabr(volatility_type) without return types