class_docstr: Convenience object to retrieve options from the optimizer param_groups.
  
  For instance, to get the current learning rate in the optimizer, instead of
  traversing optimizer.param_groups and finding all values for the "lr" key,
  you can just read options_view.lr. This means we don't need to keep an
  extra copy of optimizer options (such as lr, momentum) that might become
  inconsistent with the actual values used.
class_docstr_tok: ["Convenience","object","to","retrieve","options","from","the","optimizer","param_groups",".","For","instance",",","to","get","the","current","learning","rate","in","the","optimizer",",","instead","of","traversing","optimizer.param_groups","and","finding","all","values","for","the","``","lr","''","key",",","you","can","just","read","options_view.lr",".","This","means","we","do","n't","need","to","keep","an","extra","copy","of","optimizer","options","(","such","as","lr",",","momentum",")","that","might","become","inconsistent","with","the","actual","values","used","."]
code: def __getattr__(self, name):
      values = []
      for pg in self.optimizer.param_groups:
          if name in pg and (pg[name] not in values):
              # we only add unique values to the view
              # this means the length returned can vary if multiple (different)
              # schedulers return the same value at a certain point
              values.append(pg[name])
  
      if len(values) == 0:
          raise AttributeError
      elif len(values) == 1:
          return values.pop()
  
      return values
  
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 2 for calling the OptionsView obj's underlying member method code with example usage: obj.__getattr__(name) and returns: values, values