class_docstr: Args:
      params (iterable): iterable of parameters to optimize or dicts defining
          parameter groups
      lr (float): learning rate (required)
class_docstr_tok: ["Args",":","params","(","iterable",")",":","iterable","of","parameters","to","optimize","or","dicts","defining","parameter","groups","lr","(","float",")",":","learning","rate","(","required",")"]
docstr: Performs a single optimization step.
  Arguments:
      closure (callable, optional): A closure that reevaluates the model
          and returns the loss.
docstr_tok: ["Performs","a","single","optimization","step",".","Arguments",":","closure","(","callable",",","optional",")",":","A","closure","that","reevaluates","the","model","and","returns","the","loss","."]
code: def step(self, closure=None):
      """Performs a single optimization step.
      Arguments:
          closure (callable, optional): A closure that reevaluates the model
              and returns the loss.
      """
      loss = None
      if closure is not None:
          loss = closure()
  
      for group in self.param_groups:
          for p in group["params"]:
              if p.grad is None:
                  continue
              d_p = p.grad.data
              p.data.add_(d_p, alpha=-group["lr"])
      return loss
  
imports: import torch
  from torch import nn
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader, Dataset
  from fairscale.experimental.nn.ampnet_pipe.pipe import AMPnetPipe
  from fairscale.fair_dev.testing.testing import get_worker_map, torch_spawn
label_desc: Use image node_id 3 for calling the MySGD obj's underlying member method code with example usage: obj.step(closure) and returns: loss