code: def asgd(
      params: List[Tensor],
      grads: List[Tensor],
      axs: List[Tensor],
      mus: List[Tensor],
      etas: List[Tensor],
      state_steps: List[Tensor],
      # kwonly args with defaults are not supported by functions compiled with torchscript issue #70627
      # setting this as kwarg for now as functional API is compiled by torch/distributed/optim
      foreach: Optional[bool] = None,
      maximize: bool = False,
      differentiable: bool = False,
      capturable: bool = False,
      has_complex: bool = False,
      *,
      lambd: float,
      lr: float,
      t0: float,
      alpha: float,
      weight_decay: float,
  ):
      r"""Functional API that performs asgd algorithm computation.
  
      See :class:`~torch.optim.ASGD` for details.
      """
      if foreach is None:
          _, foreach = _default_to_fused_or_foreach(
              params, differentiable, use_fused=False
          )
  
      if foreach and torch.jit.is_scripting():
          raise RuntimeError(
              "torch.jit.script not supported with foreach optimizers"
          )
  
      if foreach and not torch.jit.is_scripting():
          func = _multi_tensor_asgd
      else:
          if capturable and not is_compiling():
              raise RuntimeError(
                  "Capturable not supported with single tensor ASGD"
              )
          func = _single_tensor_asgd
  
      func(
          params,
          grads,
          axs,
          mus,
          etas,
          state_steps,
          lambd=lambd,
          lr=lr,
          t0=t0,
          alpha=alpha,
          weight_decay=weight_decay,
          maximize=maximize,
          differentiable=differentiable,
          capturable=capturable,
          has_complex=has_complex,
      )
  
file_path: pytorch/torch/optim/asgd.py
imports: import torch
  from torch import Tensor
  from .optimizer import Optimizer, _use_grad_for_differentiable, _get_value, _default_to_fused_or_foreach, _get_scalar_dtype, _view_as_real, _differentiable_doc, _foreach_doc, _maximize_doc, _capturable_doc
  from torch._utils import is_compiling
  from typing import List, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: asgd(params, grads, axs, mus, etas, state_steps, foreach, maximize, differentiable, capturable, has_complex) without return types