code: def _init_group(
      self,
      group,
      params_with_grad,
      grads,
      exp_avgs,
      exp_infs,
      state_steps,
  ):
      has_complex = False
      for p in group["params"]:
          if p.grad is None:
              continue
          has_complex |= torch.is_complex(p)
          params_with_grad.append(p)
          if p.grad.is_sparse:
              raise RuntimeError(
                  "Adamax does not support sparse gradients"
              )
          grads.append(p.grad)
  
          state = self.state[p]
  
          # State initialization
          if len(state) == 0:
              state["step"] = torch.tensor(
                  0.0, dtype=_get_scalar_dtype()
              )
              state["exp_avg"] = torch.zeros_like(
                  p, memory_format=torch.preserve_format
              )
              state["exp_inf"] = torch.zeros_like(
                  p, memory_format=torch.preserve_format
              )
  
          exp_avgs.append(state["exp_avg"])
          exp_infs.append(state["exp_inf"])
          state_steps.append(state["step"])
      return has_complex
  
file_path: pytorch/torch/optim/adamax.py
imports: import torch
  from torch import Tensor
  from .optimizer import Optimizer, _use_grad_for_differentiable, _get_value, _stack_if_compiling, _default_to_fused_or_foreach, _get_scalar_dtype, _differentiable_doc, _maximize_doc, _foreach_doc, _view_as_real
  from typing import List, Optional
label_desc: Use image node_id 3 for calling the Adamax obj's underlying member method code with example usage: obj._init_group(group, params_with_grad, grads, exp_avgs, exp_infs, state_steps) and returns: has_complex