class_docstr: Wrap `opt` in a lookahead optimizer
class_docstr_tok: ["Wrap","`","opt","`","in","a","lookahead","optimizer"]
code: def step(self, closure=None):
      if closure is not None:
          raise NotImplementedError(
              "fastai optimizers currently do not support closure"
          )
      if self.slow_weights is None:
          self._copy_weights()
      self.opt.step()
      self.count += 1
      if self.count % self.k != 0:
          return
      for slow_pg, fast_pg in zip(self.slow_weights, self.param_lists):
          for slow_p, fast_p in zip(slow_pg, fast_pg):
              slow_p.data.add_(
                  fast_p.data - slow_p.data, alpha=self.alpha
              )
              fast_p.data.copy_(slow_p.data)
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 2 for calling the Lookahead obj's underlying member method code with example usage: obj.step(closure) without return types