class_docstr: Class to manage a scheduled (framework-dependent) tensor variable.
  
  Uses the PiecewiseSchedule (for maximum configuration flexibility)
docstr: Initializes a Scheduler instance.
  
  Args:
      fixed_value_or_schedule: A fixed, constant value (in case no schedule should
          be used) or a schedule configuration in the format of
          [[timestep, value], [timestep, value], ...]
          Intermediary timesteps will be assigned to linerarly interpolated
          values. A schedule config's first entry must
          start with timestep 0, i.e.: [[0, initial_value], [...]].
      framework: The framework string, for which to create the tensor variable
          that hold the current value. This is the variable that can be used in
          the graph, e.g. in a loss function.
      device: Optional device (for torch) to place the tensor variable on.
docstr_tok: ["Initializes","a","Scheduler","instance",".","Args",":","fixed_value_or_schedule",":","A","fixed",",","constant","value","(","in","case","no","schedule","should","be","used",")","or","a","schedule","configuration","in","the","format","of","[","[","timestep",",","value","]",",","[","timestep",",","value","]",",","...","]","Intermediary","timesteps","will","be","assigned","to","linerarly","interpolated","values",".","A","schedule","config","'s","first","entry","must","start","with","timestep","0",",","i.e",".",":","[","[","0",",","initial_value","]",",","[","...","]","]",".","framework",":","The","framework","string",",","for","which","to","create","the","tensor","variable","that","hold","the","current","value",".","This","is","the","variable","that","can","be","used","in","the","graph",",","e.g",".","in","a","loss","function",".","device",":","Optional","device","(","for","torch",")","to","place","the","tensor","variable","on","."]
code: def __init__(
      self,
      *,
      fixed_value_or_schedule: LearningRateOrSchedule,
      framework: str = "torch",
      device: Optional[str] = None,
  ):
      """Initializes a Scheduler instance.
  
      Args:
          fixed_value_or_schedule: A fixed, constant value (in case no schedule should
              be used) or a schedule configuration in the format of
              [[timestep, value], [timestep, value], ...]
              Intermediary timesteps will be assigned to linerarly interpolated
              values. A schedule config's first entry must
              start with timestep 0, i.e.: [[0, initial_value], [...]].
          framework: The framework string, for which to create the tensor variable
              that hold the current value. This is the variable that can be used in
              the graph, e.g. in a loss function.
          device: Optional device (for torch) to place the tensor variable on.
      """
      self.framework = framework
      self.device = device
      self.use_schedule = isinstance(
          fixed_value_or_schedule, (list, tuple)
      )
  
      if self.use_schedule:
          # Custom schedule, based on list of
          # ([ts], [value to be reached by ts])-tuples.
          self._schedule = PiecewiseSchedule(
              fixed_value_or_schedule,
              outside_value=fixed_value_or_schedule[-1][-1],
              framework=None,
          )
          # As initial tensor valie, use the first timestep's (must be 0) value.
          self._curr_value = self._create_tensor_variable(
              initial_value=fixed_value_or_schedule[0][1]
          )
  
      # If no schedule, pin (fix) given value.
      else:
          self._curr_value = fixed_value_or_schedule
  
file_path: ray/rllib/utils/schedules/scheduler.py
imports: from typing import Optional
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.schedules.piecewise_schedule import PiecewiseSchedule
  from ray.rllib.utils.typing import LearningRateOrSchedule, TensorType
label_desc: Use image node_id 1 to create a new Scheduler object  with example: obj = Scheduler()