class_docstr: Optimizer hook for distributed training.
class_docstr_tok: ["Optimizer","hook","for","distributed","training","."]
code: def after_train_iter(self, runner):
      runner.outputs["loss"] /= self.update_interval
      if self.use_fp16:
          # runner.outputs['loss'].backward()
          with apex.amp.scale_loss(
              runner.outputs["loss"], runner.optimizer
          ) as scaled_loss:
              scaled_loss.backward()
      else:
          runner.outputs["loss"].backward()
      if self.every_n_iters(runner, self.update_interval):
          if self.grad_clip is not None:
              self.clip_grads(runner.model.parameters())
          runner.optimizer.step()
          runner.optimizer.zero_grad()
  
imports: from mmcv.runner import OptimizerHook, HOOKS
label_desc: Use image node_id 3 for calling the DistOptimizerHook obj's underlying member method code with example usage: obj.after_train_iter(runner) without return types