code: def __init__(
      self,
      params,
      lr=None,
      beta1=0.9,
      beta2=0.999,
      eps1=1e-30,
      eps2=1e-3,
      cliping_threshold=1,
      non_constant_decay=True,
      enable_factorization=True,
      ams_grad=True,
      weight_decay=0,
  ):
      enable_momentum = beta1 != 0
  
      if non_constant_decay:
          ams_grad = False
  
      defaults = dict(
          lr=lr,
          beta1=beta1,
          beta2=beta2,
          eps1=eps1,
          eps2=eps2,
          cliping_threshold=cliping_threshold,
          weight_decay=weight_decay,
          ams_grad=ams_grad,
          enable_factorization=enable_factorization,
          enable_momentum=enable_momentum,
          non_constant_decay=non_constant_decay,
      )
  
      super(AdaFactor, self).__init__(params, defaults)
  
imports: import torch
  import torch.optim
  from torch.nn.utils import clip_grad_norm_
  import operator
  import functools
  from copy import copy
  from math import sqrt
  import types
  import os
  import importlib
  from onmt.utils.misc import fn_args
label_desc: Use image node_id 1 to create a new AdaFactor object from inherited base classes: torch.optim with example: obj = AdaFactor(params, lr, beta1, beta2, eps1, eps2, cliping_threshold, non_constant_decay, enable_factorization, ams_grad, weight_decay)