code: def test_cms_to_fixed_swap(self, dtype):
      start_date = dates.convert_to_date_tensor([(2021, 1, 1)])
      maturity_date = dates.convert_to_date_tensor([(2023, 1, 1)])
      valuation_date = dates.convert_to_date_tensor([(2021, 1, 1)])
      p6m = dates.periods.months(6)
      fix_spec = instruments.FixedCouponSpecs(
          coupon_frequency=p6m,
          currency="usd",
          notional=1.0,
          coupon_rate=0.02,
          daycount_convention=instruments.DayCountConvention.ACTUAL_365,
          businessday_rule=dates.BusinessDayConvention.NONE,
      )
      cms_spec = self.get_cms_coupon_spec(0.0)
  
      cms = instruments.CMSSwap(
          start_date, maturity_date, [fix_spec], [cms_spec], dtype=dtype
      )
  
      curve_dates = valuation_date + dates.periods.years(
          [0, 1, 2, 3, 5]
      )
      reference_curve = instruments.RateCurve(
          curve_dates,
          np.array([0.02, 0.02, 0.025, 0.03, 0.035], dtype=np.float64),
          valuation_date=valuation_date,
          dtype=np.float64,
      )
      market = instruments.InterestRateMarket(
          reference_curve=reference_curve,
          discount_curve=reference_curve,
      )
  
      price = self.evaluate(cms.price(valuation_date, market))
      np.testing.assert_allclose(price, 0.016629820479418966, atol=1e-7)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/cms_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 5 for calling the CMSSwapTest obj's underlying member method code with example usage: obj.test_cms_to_fixed_swap(dtype) without return types