class_docstr: Base class for optimizers.
  
  This wraps a :class:`torch.optim.Optimizer` instance and provides support
  for parameter scheduling. Typical PyTorch optimizers are used like this:
  
      optim = SGD(model.parameters(), lr=0.1)
  
  but the user is responsible for updating lr over the course of training.
  ClassyOptimizers extend PyTorch optimizers and allow specifying
  ParamSchedulers instead:
  
      optim = SGD()
      optim.set_param_groups(model.parameters(), lr=LinearParamScheduler(1, 2))
  
  This means that as you step through the optimizer, the learning rate will
  automatically get updated with the given schedule. To access the current
  learning rate value (or any other optimizer option), you can read
  `optim.options_view.lr`. Similar to other Classy abstractions, you can also
  instantiate ClassyOptimizers from a configuration file.
class_docstr_tok: ["Base","class","for","optimizers",".","This","wraps","a",":","class",":","`","torch.optim.Optimizer","`","instance","and","provides","support","for","parameter","scheduling",".","Typical","PyTorch","optimizers","are","used","like","this",":","optim","=","SGD","(","model.parameters","(",")",",","lr=0.1",")","but","the","user","is","responsible","for","updating","lr","over","the","course","of","training",".","ClassyOptimizers","extend","PyTorch","optimizers","and","allow","specifying","ParamSchedulers","instead",":","optim","=","SGD","(",")","optim.set_param_groups","(","model.parameters","(",")",",","lr=LinearParamScheduler","(","1",",","2",")",")","This","means","that","as","you","step","through","the","optimizer",",","the","learning","rate","will","automatically","get","updated","with","the","given","schedule",".","To","access","the","current","learning","rate","value","(","or","any","other","optimizer","option",")",",","you","can","read","`","optim.options_view.lr","`",".","Similar","to","other","Classy","abstractions",",","you","can","also","instantiate","ClassyOptimizers","from","a","configuration","file","."]
docstr: Perform the optimization updates for a given training step.
  
  The optimization options (such as learning rate) performed during this
  step will correspond to the where value given as an argument to this
  function. The exact values used can be read via the options_view
  property in the optimizer.
  
  Args:
      where: where we are in terms of training progress (output of
          :method:`ClassyTask.where`). Must be a float in the [0;1)
          interval; This dictates parameter scheduling;
docstr_tok: ["Perform","the","optimization","updates","for","a","given","training","step",".","The","optimization","options","(","such","as","learning","rate",")","performed","during","this","step","will","correspond","to","the","where","value","given","as","an","argument","to","this","function",".","The","exact","values","used","can","be","read","via","the","options_view","property","in","the","optimizer",".","Args",":","where",":","where","we","are","in","terms","of","training","progress","(","output","of",":","method",":","`","ClassyTask.where","`",")",".","Must","be","a","float","in","the","[","0",";","1",")","interval",";","This","dictates","parameter","scheduling",";"]
code: def step(
      self,
      *args,
      closure: Optional[Callable] = None,
      where: float = None,
  ) -> None:
      """
      Perform the optimization updates for a given training step.
  
      The optimization options (such as learning rate) performed during this
      step will correspond to the where value given as an argument to this
      function. The exact values used can be read via the options_view
      property in the optimizer.
  
      Args:
          where: where we are in terms of training progress (output of
              :method:`ClassyTask.where`). Must be a float in the [0;1)
              interval; This dictates parameter scheduling;
      """
      if where is None:
          raise RuntimeError(
              "ClassyOptimizer.step requires `where` argument to be provided"
          )
  
      assert where >= 0 and where < 1, f"Invalid where: {where}"
  
      if self._param_group_schedulers is None:
          raise RuntimeError(
              "ClassyOptimizer.set_param_groups must be called before step()"
          )
  
      self._update_schedule(
          self._run_schedulers(where, UpdateInterval.STEP)
      )
  
      if closure is None:
          self.optimizer.step()
      else:
          self.optimizer.step(closure)
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Callable, Dict, Optional
  from classy_vision.generic.util import log_class_usage
  from .param_scheduler import ConstantParamScheduler, ParamScheduler, UpdateInterval
label_desc: Use image node_id 10 for calling the ClassyOptimizer obj's underlying member method code with example usage: obj.step() without return types