docstr: Creates ir swap from proto and tests pricing method.
docstr_tok: ["Creates","ir","swap","from","proto","and","tests","pricing","method","."]
code: def test_from_proto_price(self):
      """Creates ir swap from proto and tests pricing method."""
      market = market_data.MarketDataDict(self._market_data_dict)
      swaps = interest_rate_swap.InterestRateSwap.from_protos(
          [self._swap_1, self._swap_2, self._swap_1]
      )
      with self.subTest("Batching"):
          self.assertLen(swaps, 1)
      price1 = swaps[0].price(market)
      expected1 = np.array(
          [7655.98694587, 6569.04475892, 7655.98694587]
      )
      with self.subTest("PriceBatch"):
          self.assertAllClose(price1, expected1)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/interest_rate_swap/interest_rate_swap_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 2 for calling the InterestRateSwapTest obj's underlying member method code with example usage: obj.test_from_proto_price() without return types