class_docstr: HolidayCalendar implementation.
  
  Requires the calendar to be bounded. Constructs tables of precomputed values
  of interest for each day in the calendar, which enables better performance
  compared to a more flexible UnboundedHolidayCalendar.
  
  Each instance should be used in the context of only one graph. E.g. one can't
  create a BoundedHolidayCalendar in one tf.function and reuse it in another.
class_docstr_tok: ["HolidayCalendar","implementation",".","Requires","the","calendar","to","be","bounded",".","Constructs","tables","of","precomputed","values","of","interest","for","each","day","in","the","calendar",",","which","enables","better","performance","compared","to","a","more","flexible","UnboundedHolidayCalendar",".","Each","instance","should","be","used","in","the","context","of","only","one","graph",".","E.g",".","one","can't","create","a","BoundedHolidayCalendar","in","one","tf.function","and","reuse","it","in","another","."]
docstr: Adds given number of business days to given dates.
  
  Note that this is different from calling `add_period_and_roll` with
  PeriodType.DAY. For example, adding 5 business days to Monday gives the next
  Monday (unless there are holidays on this week or next Monday). Adding 5
  days and rolling means landing on Saturday and then rolling either to next
  Monday or to Friday of the same week, depending on the roll convention.
  
  If any of the dates in `date_tensor` are not business days, they will be
  rolled to business days before doing the addition. If `roll_convention` is
  `NONE`, and any dates are not business days, an exception is raised.
  
  Args:
    date_tensor: DateTensor of dates to advance from.
    num_days: Tensor of int32 type broadcastable to `date_tensor`.
    roll_convention: BusinessDayConvention. Determines how to roll a date that
      falls on a holiday.
  
  Returns:
    The resulting DateTensor.
docstr_tok: ["Adds","given","number","of","business","days","to","given","dates",".","Note","that","this","is","different","from","calling","`","add_period_and_roll","`","with","PeriodType.DAY",".","For","example",",","adding","5","business","days","to","Monday","gives","the","next","Monday","(","unless","there","are","holidays","on","this","week","or","next","Monday",")",".","Adding","5","days","and","rolling","means","landing","on","Saturday","and","then","rolling","either","to","next","Monday","or","to","Friday","of","the","same","week",",","depending","on","the","roll","convention",".","If","any","of","the","dates","in","`","date_tensor","`","are","not","business","days",",","they","will","be","rolled","to","business","days","before","doing","the","addition",".","If","`","roll_convention","`","is","`","NONE","`",",","and","any","dates","are","not","business","days",",","an","exception","is","raised",".","Args",":","date_tensor",":","DateTensor","of","dates","to","advance","from",".","num_days",":","Tensor","of","int32","type","broadcastable","to","`","date_tensor","`",".","roll_convention",":","BusinessDayConvention",".","Determines","how","to","roll","a","date","that","falls","on","a","holiday",".","Returns",":","The","resulting","DateTensor","."]
code: def add_business_days(
      self,
      date_tensor,
      num_days,
      roll_convention=constants.BusinessDayConvention.NONE,
  ):
      """Adds given number of business days to given dates.
  
      Note that this is different from calling `add_period_and_roll` with
      PeriodType.DAY. For example, adding 5 business days to Monday gives the next
      Monday (unless there are holidays on this week or next Monday). Adding 5
      days and rolling means landing on Saturday and then rolling either to next
      Monday or to Friday of the same week, depending on the roll convention.
  
      If any of the dates in `date_tensor` are not business days, they will be
      rolled to business days before doing the addition. If `roll_convention` is
      `NONE`, and any dates are not business days, an exception is raised.
  
      Args:
        date_tensor: DateTensor of dates to advance from.
        num_days: Tensor of int32 type broadcastable to `date_tensor`.
        roll_convention: BusinessDayConvention. Determines how to roll a date that
          falls on a holiday.
  
      Returns:
        The resulting DateTensor.
      """
      control_deps = []
      if roll_convention == constants.BusinessDayConvention.NONE:
          message = (
              "Some dates in date_tensor are not business days. "
              "Please specify the roll_convention argument."
          )
          is_bus_day = self.is_business_day(date_tensor)
          control_deps.append(
              tf.debugging.assert_equal(
                  is_bus_day, True, message=message
              )
          )
      else:
          date_tensor = self.roll_to_business_day(
              date_tensor, roll_convention
          )
  
      with tf.control_dependencies(control_deps):
          cumul_bus_days_table = self._compute_cumul_bus_days_table()
          cumul_bus_days = self._gather(
              cumul_bus_days_table,
              date_tensor.ordinal() - self._ordinal_offset + 1,
          )
          target_cumul_bus_days = cumul_bus_days + num_days
  
          bus_day_ordinals_table = (
              self._compute_bus_day_ordinals_table()
          )
          ordinals = self._gather(
              bus_day_ordinals_table, target_cumul_bus_days
          )
          with tf.control_dependencies(
              self._assert_ordinals_in_bounds(ordinals)
          ):
              return dt.from_ordinals(ordinals, validate=False)
  
imports: import attr
  import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_tensor
  from tf_quant_finance.datetime import holiday_calendar
  from tf_quant_finance.datetime import periods
label_desc: Use image node_id 5 for calling the BoundedHolidayCalendar obj's underlying member method code with example usage: obj.add_business_days(date_tensor, num_days, roll_convention) and returns: dt