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: Initialize a batch of floating cashflow streams.
  
  Args:
    start_date: A rank 1 `DateTensor` specifying the starting dates of the
      accrual of the first coupon of the cashflow stream. The shape of the
      input correspond to the numbercof streams being created.
    end_date: A rank 1 `DateTensor` specifying the end dates for accrual of
      the last coupon in each cashflow stream. The shape of the input should
      be the same as that of `start_date`.
    coupon_spec: A scalar or a list of `FloatCouponSpecs` specifying the
      details of the coupon payment for the cashflow stream. If specified as
      a list then the length of the list should be the same as the number of
      streams being created and each coupon within the list must have the
      same daycount_convention and businessday_rule. If specified as
      a scalar, then the elements of the namedtuple must be of the same shape
      as (or compatible to) the shape of `start_date`.
    first_coupon_date: An optional rank 1 `DateTensor` specifying the payment
      dates of the first coupon of the cashflow stream. Use this input for
      cashflows with irregular first coupon.
      Default value: None which implies regular first coupon.
    penultimate_coupon_date: An optional rank 1 `DateTensor` specifying the
      payment date of the penultimate (next to last) coupon of the cashflow
      stream. Use this input for cashflows with irregular last coupon.
      Default value: None which implies regular last coupon.
    dtype: `tf.Dtype`. If supplied the dtype for the real variables or ops
      either supplied to the FloatingCashflowStream object or created by the
      object.
      Default value: None which maps to the default dtype inferred by
      TensorFlow.
    name: Python str. The name to give to the ops created by this class.
      Default value: `None` which maps to 'floating_cashflow_stream'.
docstr_tok: ["Initialize","a","batch","of","floating","cashflow","streams",".","Args",":","start_date",":","A","rank","1","`","DateTensor","`","specifying","the","starting","dates","of","the","accrual","of","the","first","coupon","of","the","cashflow","stream",".","The","shape","of","the","input","correspond","to","the","numbercof","streams","being","created",".","end_date",":","A","rank","1","`","DateTensor","`","specifying","the","end","dates","for","accrual","of","the","last","coupon","in","each","cashflow","stream",".","The","shape","of","the","input","should","be","the","same","as","that","of","`","start_date","`",".","coupon_spec",":","A","scalar","or","a","list","of","`","FloatCouponSpecs","`","specifying","the","details","of","the","coupon","payment","for","the","cashflow","stream",".","If","specified","as","a","list","then","the","length","of","the","list","should","be","the","same","as","the","number","of","streams","being","created","and","each","coupon","within","the","list","must","have","the","same","daycount_convention","and","businessday_rule",".","If","specified","as","a","scalar",",","then","the","elements","of","the","namedtuple","must","be","of","the","same","shape","as","(","or","compatible","to",")","the","shape","of","`","start_date","`",".","first_coupon_date",":","An","optional","rank","1","`","DateTensor","`","specifying","the","payment","dates","of","the","first","coupon","of","the","cashflow","stream",".","Use","this","input","for","cashflows","with","irregular","first","coupon",".","Default","value",":","None","which","implies","regular","first","coupon",".","penultimate_coupon_date",":","An","optional","rank","1","`","DateTensor","`","specifying","the","payment","date","of","the","penultimate","(","next","to","last",")","coupon","of","the","cashflow","stream",".","Use","this","input","for","cashflows","with","irregular","last","coupon",".","Default","value",":","None","which","implies","regular","last","coupon",".","dtype",":","`","tf.Dtype","`",".","If","supplied","the","dtype","for","the","real","variables","or","ops","either","supplied","to","the","FloatingCashflowStream","object","or","created","by","the","object",".","Default","value",":","None","which","maps","to","the","default","dtype","inferred","by","TensorFlow",".","name",":","Python","str",".","The","name","to","give","to","the","ops","created","by","this","class",".","Default","value",":","`","None","`","which","maps","to","'floating_cashflow_stream","'","."]
code: def __init__(
      self,
      start_date,
      end_date,
      coupon_spec,
      first_coupon_date=None,
      penultimate_coupon_date=None,
      dtype=None,
      name=None,
  ):
      """Initialize a batch of floating cashflow streams.
  
      Args:
        start_date: A rank 1 `DateTensor` specifying the starting dates of the
          accrual of the first coupon of the cashflow stream. The shape of the
          input correspond to the numbercof streams being created.
        end_date: A rank 1 `DateTensor` specifying the end dates for accrual of
          the last coupon in each cashflow stream. The shape of the input should
          be the same as that of `start_date`.
        coupon_spec: A scalar or a list of `FloatCouponSpecs` specifying the
          details of the coupon payment for the cashflow stream. If specified as
          a list then the length of the list should be the same as the number of
          streams being created and each coupon within the list must have the
          same daycount_convention and businessday_rule. If specified as
          a scalar, then the elements of the namedtuple must be of the same shape
          as (or compatible to) the shape of `start_date`.
        first_coupon_date: An optional rank 1 `DateTensor` specifying the payment
          dates of the first coupon of the cashflow stream. Use this input for
          cashflows with irregular first coupon.
          Default value: None which implies regular first coupon.
        penultimate_coupon_date: An optional rank 1 `DateTensor` specifying the
          payment date of the penultimate (next to last) coupon of the cashflow
          stream. Use this input for cashflows with irregular last coupon.
          Default value: None which implies regular last coupon.
        dtype: `tf.Dtype`. If supplied the dtype for the real variables or ops
          either supplied to the FloatingCashflowStream object or created by the
          object.
          Default value: None which maps to the default dtype inferred by
          TensorFlow.
        name: Python str. The name to give to the ops created by this class.
          Default value: `None` which maps to 'floating_cashflow_stream'.
      """
  
      super(FloatingCashflowStream, self).__init__()
      self._name = name or "floating_cashflow_stream"
  
      with tf.name_scope(self._name):
          self._start_date = dates.convert_to_date_tensor(start_date)
          self._end_date = dates.convert_to_date_tensor(end_date)
          self._batch_size = self._start_date.shape[0]
          if first_coupon_date is None:
              self._first_coupon_date = None
          else:
              self._first_coupon_date = dates.convert_to_date_tensor(
                  first_coupon_date
              )
  
          if penultimate_coupon_date is None:
              self._penultimate_coupon_date = None
          else:
              self._penultimate_coupon_date = (
                  dates.convert_to_date_tensor(penultimate_coupon_date)
              )
  
          self._dtype = dtype
  
          self._setup(coupon_spec)
  
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 1 to create a new FloatingCashflowStream object from inherited base classes: CashflowStream with example: obj = FloatingCashflowStream(start_date, end_date, coupon_spec, first_coupon_date, penultimate_coupon_date, dtype, name)