code: def rate_leg_cashflows(
      coupon_rates, notional, daycount_fractions, dtype=None, name=None
  ):
      """Computes cashflows for a batch or interest rate legs.
  
      #### Example
      ```python
      coupon_rates = [[0.1, 0.1, 0.1], [0.02, 0.12, 0.14]]
      notional = 1000
      daycount_fractions = [[1, 1, 1], [1, 2, 1]]
      rate_leg_cashflows(
          coupon_rates, notional, daycount_fractions, dtype=tf.float64)
      # Expected:
      #  [[100.0, 100.0, 100.0],
      #   [ 20.0, 240.0, 140.0]]
      ```
  
      Args:
        coupon_rates: A real `Tensor` of shape `batch_shape + [num_cashflows]`,
          where `num_cashflows` is the number of cashflows for each batch element.
          Coupon rates for each cashflow of the leg. Can be a scalar for a fixed
          leg or represent forward rates for a floating leg.
        notional: A `Tensor` of the same `dtype` as `coupon_rates` and of
          compatible shape. Notional amount for each cashflow.
        daycount_fractions: A `Tensor` of the same `dtype` as `coupon_rates` and of
          compatible shape. Year fractions for the coupon accrual.
        dtype: `tf.Dtype`. If supplied the dtype for the input and output `Tensor`s.
          Default value: None which maps to the default dtype inferred from
          `coupon_rates`.
        name: Python str. The name to give to the ops created by this function.
          Default value: None which maps to 'rate_leg_cashflows'.
  
      Returns:
        A `Tensor` of the same `dtype` as `coupon_rates` and of shape
        `batch_shape + [num_cashflows]`.
      """
      name = name or "rate_leg_cashflows"
      with tf.name_scope(name):
          coupon_rates = tf.convert_to_tensor(
              coupon_rates, dtype=dtype, name="coupon_rates"
          )
          dtype = dtype or coupon_rates.dtype
          daycount_fractions = tf.convert_to_tensor(
              daycount_fractions, dtype=dtype, name="daycount_fractions"
          )
          notional = tf.convert_to_tensor(
              notional, dtype=dtype, name="notional"
          )
          return notional * daycount_fractions * coupon_rates
  
file_path: tf-quant-finance/tf_quant_finance/rates/analytics/swap.py
imports: import tensorflow.compat.v2
  from tf_quant_finance.rates.analytics import cashflows
label_desc: Use image node_id 3 for calling a global function with example usage: rate_leg_cashflows(coupon_rates, notional, daycount_fractions, dtype, name) and returns: unknown