def _update_impl(self, indices, weight, grad, state, multi_precision=False):
try:<EOL><INDENT>from mxnet.ndarray.contrib import adamw_update<EOL><DEDENT>except ImportError:<EOL><INDENT>raise ImportError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>self._update_count(indices)<EOL>lr = self._get_lr(indices)<EOL>wd = self._get_wd(indices)<EOL>if not isinstance(self.rescale_grad, NDArray):<EOL><INDENT>self.rescale_grad = full(shape=(<NUM_LIT:1>,), val=self.rescale_grad, ctx=weight.context)<EOL><DEDENT>else:<EOL><INDENT>self.rescale_grad = self.rescale_grad.as_in_context(weight.context)<EOL><DEDENT>kwargs = {'<STR_LIT>': self.beta1, '<STR_LIT>': self.beta2, '<STR_LIT>': self.epsilon,<EOL>'<STR_LIT>': self.rescale_grad}<EOL>if self.clip_gradient:<EOL><INDENT>kwargs['<STR_LIT>'] = self.clip_gradient<EOL><DEDENT>if not multi_precision:<EOL><INDENT>mean, var = state<EOL>adamw_update(weight, grad, mean, var, out=weight,<EOL>lr=<NUM_LIT:1>, wd=wd, eta=lr, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>from mxnet.ndarray.contrib import mp_adamw_update<EOL><DEDENT>except ImportError:<EOL><INDENT>raise ImportError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>mean, var = state[<NUM_LIT:0>]<EOL>mp_adamw_update(weight, grad, mean, var, state[<NUM_LIT:1>], out=weight,<EOL>lr=<NUM_LIT:1>, wd=wd, eta=lr, **kwargs)<EOL><DEDENT>
update function