diff --git a/example/gluon/sn_gan/model.py b/example/gluon/sn_gan/model.py index 6040adb4eeac..cfd7f93e8dae 100644 --- a/example/gluon/sn_gan/model.py +++ b/example/gluon/sn_gan/model.py @@ -21,7 +21,7 @@ import mxnet as mx from mxnet import nd -from mxnet import gluon +from mxnet import gluon, autograd from mxnet.gluon import Block @@ -68,7 +68,8 @@ def _spectral_norm(self): if sigma == 0.: sigma = EPSILON - self.params.setattr('u', _u) + with autograd.pause(): + self.u.set_data(_u) return w / sigma