code: def test_cap_price_lognormal_rate_model(self, dtype):
      notional = 100.0
      period3m = dates.periods.months(3)
      cap = instruments.CapAndFloor(
          self.start_date,
          self.maturity_date,
          period3m,
          0.005,
          daycount_convention=instruments.DayCountConvention.ACTUAL_365,
          notional=notional,
          dtype=dtype,
      )
      price = self.evaluate(
          cap._price_lognormal_rate(
              dates.convert_to_date_tensor(self.valuation_date),
              self.get_market(),
              pricing_context=0.5,
          )
      )
      print(price)
      np_testing.assert_allclose(
          price, [0.146671, 0.218595, 0.303358, 0.378782], atol=1e-6
      )
  
file_path: tf-quant-finance/tf_quant_finance/experimental/instruments/cap_floor_test.py
imports: from absl.testing import parameterized
  import numpy
  from numpy import testing
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 8 for calling the CapFloorTest obj's underlying member method code with example usage: obj.test_cap_price_lognormal_rate_model(dtype) without return types