code: def _initial_discount_rates(
      bond_cashflows,
      bond_cashflow_times,
      present_values,
      name="initial_discount_rates",
  ):
      """Constructs a guess for the initial rates as the yields to maturity."""
      n = len(bond_cashflows)
      groups = []
      for i in range(n):
          groups.append(tf.fill(tf.shape(bond_cashflows[i]), i))
      bond_cashflows = tf.concat(bond_cashflows, axis=0)
      bond_cashflow_times = tf.concat(bond_cashflow_times, axis=0)
      groups = tf.concat(groups, axis=0)
      return cashflows.yields_from_pv(
          bond_cashflows,
          bond_cashflow_times,
          present_values,
          groups=groups,
          name=name,
      )
  
file_path: tf-quant-finance/tf_quant_finance/rates/hagan_west/bond_curve.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.rates.analytics import cashflows
  from tf_quant_finance.rates.hagan_west import monotone_convex
label_desc: Use image node_id 3 for calling a global function with example usage: _initial_discount_rates(bond_cashflows, bond_cashflow_times, present_values, name) and returns: cashflows