code: def ref_impl(
      m,
      v,
      weight,
      grad_rescale,
      beta1,
      beta2,
      lr,
      eta,
      wd,
      epsilon,
      clip_grad=-1,
  ):
      if clip_grad >= 0:
          grad_rescale = mx.nd.clip(grad_rescale, -clip_grad, clip_grad)
  
      mean_ref = beta1 * m + (1.0 - beta1) * grad_rescale
      v_ref = beta2 * v + (1.0 - beta2) * (grad_rescale**2)
      weight_ref = weight - eta * (
          lr * mean_ref / (v_ref.sqrt() + epsilon) + weight * wd
      )
      return mean_ref, v_ref, weight_ref
  
file_path: mxnet/tests/python/unittest/test_contrib_optimizer.py
imports: import itertools
  import numpy
  import mxnet
  from mxnet.test_utils import *
  import pytest
  from common import xfail_when_nonstandard_decimal_separator
label_desc: Use image node_id 1 for calling the _AdamWTestHelper obj's underlying member method code with example usage: obj.ref_impl(m, v, weight, grad_rescale, beta1, beta2, lr, eta, wd, epsilon, clip_grad) and returns: mean_ref,  v_ref,  weight_ref