class_docstr: Mixin for TorchPolicy that adds a learning rate schedule.
class_docstr_tok: ["Mixin","for","TorchPolicy","that","adds","a","learning","rate","schedule","."]
code: def on_global_var_update(self, global_vars):
      super().on_global_var_update(global_vars)
      if self._lr_schedule and not self.config.get(
          "_enable_new_api_stack", False
      ):
          self.cur_lr = self._lr_schedule.value(global_vars["timestep"])
          for opt in self._optimizers:
              for p in opt.param_groups:
                  p["lr"] = self.cur_lr
  
imports: from ray.rllib.policy.policy import Policy, PolicyState
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_policy import TorchPolicy
  from ray.rllib.utils.annotations import DeveloperAPI, override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.schedules import PiecewiseSchedule
label_desc: Use image node_id 2 for calling the LearningRateSchedule obj's underlying member method code with example usage: obj.on_global_var_update(global_vars) without return types