code: def test_forward_rates_from_yields(self, dtype):
      groups = np.array([0, 0, 0, 1, 1, 1, 1])
      times = np.array(
          [0.25, 0.5, 1.0, 0.25, 0.5, 1.0, 1.5], dtype=dtype
      )
      rates = np.array(
          [0.04, 0.041, 0.044, 0.022, 0.025, 0.028, 0.036], dtype=dtype
      )
      forward_rates = self.evaluate(
          tff.rates.analytics.forwards.forward_rates_from_yields(
              rates, times, groups=groups, dtype=dtype
          )
      )
      expected_forward_rates = np.array(
          [0.04, 0.042, 0.047, 0.022, 0.028, 0.031, 0.052], dtype=dtype
      )
      np.testing.assert_allclose(
          forward_rates, expected_forward_rates, atol=1e-6
      )
  
file_path: tf-quant-finance/tf_quant_finance/rates/analytics/forwards_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 ForwardRatesTest obj's underlying member method code with example usage: obj.test_forward_rates_from_yields(dtype) without return types