class_docstr: Represents a batch of cashflows indexed to a floating rate.
  
  #### Example:
  The following example illustrates the construction of an floating
  cashflow stream and calculating its present value.
  
  ```python
  import numpy as np
  import tensorflow as tf
  import tf_quant_finance as tff
  dates = tff.datetime
  instruments = tff.experimental.instruments
  rc = tff.experimental.instruments.rates_common
  
  dtype = np.float64
  start_date = dates.convert_to_date_tensor([(2020, 2, 2)])
  maturity_date = dates.convert_to_date_tensor([(2023, 2, 2)])
  valuation_date = dates.convert_to_date_tensor([(2020, 2, 2)])
  period_3m = dates.months(3)
  flt_spec = instruments.FloatCouponSpecs(
              coupon_frequency=periods_3m, reference_rate_term=periods_3m,
              reset_frequency=periods_3m, currency='usd', notional=1.,
              businessday_rule=dates.BusinessDayConvention.NONE,
              coupon_basis=0., coupon_multiplier=1.,
              daycount_convention=rc.DayCountConvention.ACTUAL_365)
  
  cf_stream = instruments.FloatingCashflowStream([start_date], [maturity_date],
                                                 [flt_spec], dtype=dtype)
  
  curve_dates = valuation_date + dates.years([1, 2, 3, 5, 7, 10, 30])
  reference_curve = instruments.RateCurve(
      curve_dates,
      np.array([
        0.02834814, 0.03077457, 0.03113739, 0.03130794, 0.03160892,
        0.03213901, 0.03257991
        ], dtype=dtype),
      dtype=dtype)
  market = instruments.InterestRateMarket(
      reference_curve=reference_curve, discount_curve=reference_curve)
  
  price = cf_stream.price(valuation_date, market)
  # Expected result: 89259.685614769
  ```
class_docstr_tok: ["Represents","a","batch","of","cashflows","indexed","to","a","floating","rate",".","#","#","#","#","Example",":","The","following","example","illustrates","the","construction","of","an","floating","cashflow","stream","and","calculating","its","present","value",".","``","`","python","import","numpy","as","np","import","tensorflow","as","tf","import","tf_quant_finance","as","tff","dates","=","tff.datetime","instruments","=","tff.experimental.instruments","rc","=","tff.experimental.instruments.rates_common","dtype","=","np.float64","start_date","=","dates.convert_to_date_tensor","(","[","(","2020",",","2",",","2",")","]",")","maturity_date","=","dates.convert_to_date_tensor","(","[","(","2023",",","2",",","2",")","]",")","valuation_date","=","dates.convert_to_date_tensor","(","[","(","2020",",","2",",","2",")","]",")","period_3m","=","dates.months","(","3",")","flt_spec","=","instruments.FloatCouponSpecs","(","coupon_frequency=periods_3m",",","reference_rate_term=periods_3m",",","reset_frequency=periods_3m",",","currency='usd","'",",","notional=1.",",","businessday_rule=dates.BusinessDayConvention.NONE",",","coupon_basis=0.",",","coupon_multiplier=1.",",","daycount_convention=rc.DayCountConvention.ACTUAL_365",")","cf_stream","=","instruments.FloatingCashflowStream","(","[","start_date","]",",","[","maturity_date","]",",","[","flt_spec","]",",","dtype=dtype",")","curve_dates","=","valuation_date","+","dates.years","(","[","1",",","2",",","3",",","5",",","7",",","10",",","30","]",")","reference_curve","=","instruments.RateCurve","(","curve_dates",",","np.array","(","[","0.02834814",",","0.03077457",",","0.03113739",",","0.03130794",",","0.03160892",",","0.03213901",",","0.03257991","]",",","dtype=dtype",")",",","dtype=dtype",")","market","=","instruments.InterestRateMarket","(","reference_curve=reference_curve",",","discount_curve=reference_curve",")","price","=","cf_stream.price","(","valuation_date",",","market",")","#","Expected","result",":","89259.685614769","``","`"]
docstr: Returns the present value of the stream on the valuation date.
  
  Args:
    valuation_date: A scalar `DateTensor` specifying the date on which
      valuation is being desired.
    market: A namedtuple of type `InterestRateMarket` which contains the
      necessary information for pricing the cashflow stream.
    model: Reserved for future use.
    pricing_context: Additional context relevant for pricing.
    name: Python str. The name to give to the ops created by this function.
      Default value: `None` which maps to 'price'.
  
  Returns:
    A Rank 1 `Tensor` of real type containing the modeled price of each stream
    contract based on the input market data.
docstr_tok: ["Returns","the","present","value","of","the","stream","on","the","valuation","date",".","Args",":","valuation_date",":","A","scalar","`","DateTensor","`","specifying","the","date","on","which","valuation","is","being","desired",".","market",":","A","namedtuple","of","type","`","InterestRateMarket","`","which","contains","the","necessary","information","for","pricing","the","cashflow","stream",".","model",":","Reserved","for","future","use",".","pricing_context",":","Additional","context","relevant","for","pricing",".","name",":","Python","str",".","The","name","to","give","to","the","ops","created","by","this","function",".","Default","value",":","`","None","`","which","maps","to","'price","'",".","Returns",":","A","Rank","1","`","Tensor","`","of","real","type","containing","the","modeled","price","of","each","stream","contract","based","on","the","input","market","data","."]
code: def price(
      self,
      valuation_date,
      market,
      model=None,
      pricing_context=None,
      name=None,
  ):
      """Returns the present value of the stream on the valuation date.
  
      Args:
        valuation_date: A scalar `DateTensor` specifying the date on which
          valuation is being desired.
        market: A namedtuple of type `InterestRateMarket` which contains the
          necessary information for pricing the cashflow stream.
        model: Reserved for future use.
        pricing_context: Additional context relevant for pricing.
        name: Python str. The name to give to the ops created by this function.
          Default value: `None` which maps to 'price'.
  
      Returns:
        A Rank 1 `Tensor` of real type containing the modeled price of each stream
        contract based on the input market data.
      """
  
      del model, pricing_context
      name = name or (self._name + "_price")
      with tf.name_scope(name):
          discount_curve = market.discount_curve
          reference_curve = market.reference_curve
          libor_rate = rc.get_rate_index(
              market,
              self._start_date,
              rc.RateIndexType.LIBOR,
              dtype=self._dtype,
          )
          libor_rate = tf.repeat(
              tf.convert_to_tensor(libor_rate, dtype=self._dtype),
              self._num_cashflows,
          )
  
          discount_factors = discount_curve.get_discount_factor(
              self._payment_dates
          )
          forward_rates = reference_curve.get_forward_rate(
              self._accrual_start_date,
              self._accrual_end_date,
              self._daycount_fractions,
          )
  
          forward_rates = tf.where(
              self._daycount_fractions > 0.0,
              forward_rates,
              tf.zeros_like(forward_rates),
          )
          # If coupon end date is before the valuation date, the payment is in the
          # past. If valuation date is between coupon start date and coupon end
          # date, then the rate has been fixed but not paid. Otherwise the rate is
          # not fixed and should be read from the curve.
          forward_rates = tf.where(
              self._coupon_end_dates < valuation_date,
              tf.constant(0.0, dtype=self._dtype),
              tf.where(
                  self._coupon_start_dates < valuation_date,
                  libor_rate,
                  forward_rates,
              ),
          )
  
          coupon_rate = self._coupon_multiplier * (
              forward_rates + self._coupon_basis
          )
  
          cashflow_pvs = self._notional * (
              self._daycount_fractions * coupon_rate * discount_factors
          )
          return tf.math.reduce_sum(
              tf.reshape(
                  cashflow_pvs, (self._batch_size, self._num_cashflows)
              ),
              axis=1,
          )
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance.experimental.instruments import rates_common
label_desc: Use image node_id 2 for calling the FloatingCashflowStream obj's underlying member method code with example usage: obj.price(valuation_date, market, model, pricing_context, name) and returns: tf