code: def __call__(
      self,
      loss,
      optimizer,
      clip_grad=None,
      clip_mode="norm",
      parameters=None,
      create_graph=False,
      need_update=True,
  ):
      with amp.scale_loss(loss, optimizer) as scaled_loss:
          scaled_loss.backward(create_graph=create_graph)
      if need_update:
          if clip_grad is not None:
              dispatch_clip_grad(
                  amp.master_params(optimizer),
                  clip_grad,
                  mode=clip_mode,
              )
          optimizer.step()
  
file_path: pytorch-image-models/timm/utils/cuda.py
imports: import torch
  from .clip_grad import dispatch_clip_grad
label_desc: Use image node_id 1 for calling the ApexScaler obj's underlying member method code with example usage: obj.__call__(loss, optimizer, clip_grad, clip_mode, parameters, create_graph, need_update) without return types