class_docstr: A special loop implementing what is known in Lightning as Manual Optimization where the optimization happens
  entirely in the :meth:`~lightning.pytorch.core.LightningModule.training_step` and therefore the user is responsible
  for back-propagating gradients and making calls to the optimizers.
  
  This loop is a trivial case because it performs only a single iteration (calling directly into the module's
  :meth:`~lightning.pytorch.core.LightningModule.training_step`) and passing through the output(s).
class_docstr_tok: ["A","special","loop","implementing","what","is","known","in","Lightning","as","Manual","Optimization","where","the","optimization","happens","entirely","in","the",":","meth",":","`","~lightning.pytorch.core.LightningModule.training_step","`","and","therefore","the","user","is","responsible","for","back-propagating","gradients","and","making","calls","to","the","optimizers",".","This","loop","is","a","trivial","case","because","it","performs","only","a","single","iteration","(","calling","directly","into","the","module's",":","meth",":","`","~lightning.pytorch.core.LightningModule.training_step","`",")","and","passing","through","the","output","(","s",")","."]
code: def on_run_start(self) -> None:
      # inject logic around the optimizer step
      for (
          lightning_optimizer
      ) in self.trainer.strategy._lightning_optimizers:
          lightning_optimizer._on_before_step = self._on_before_step
          lightning_optimizer._on_after_step = self._on_after_step
  
imports: from collections import OrderedDict
  from contextlib import suppress
  from dataclasses import dataclass, field
  from typing import Any, Dict
  from torch import Tensor
  from typing_extensions import override
  import lightning.pytorch
  from lightning.pytorch.core.optimizer import do_nothing_closure
  from lightning.pytorch.loops import _Loop
  from lightning.pytorch.loops.optimization.closure import OutputResult
  from lightning.pytorch.loops.progress import _Progress, _ReadyCompletedTracker
  from lightning.pytorch.trainer import call
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import STEP_OUTPUT
label_desc: Use image node_id 3 for calling the _ManualOptimization obj's underlying member method code with example usage: obj.on_run_start() without return types