diff --git a/python/paddle/nn/layer/norm.py b/python/paddle/nn/layer/norm.py index b0e0fe323437d0e29583c37caa3f43e58bf399d0..de9f8663e67692f8c23d378abb8e1f7171943d95 100644 --- a/python/paddle/nn/layer/norm.py +++ b/python/paddle/nn/layer/norm.py @@ -75,6 +75,7 @@ class _InstanceNormBase(Layer): self._epsilon = epsilon self._weight_attr = weight_attr self._bias_attr = bias_attr + self._num_features = num_features if weight_attr != False and bias_attr != False: self.scale = self.create_parameter( @@ -101,7 +102,7 @@ class _InstanceNormBase(Layer): input, weight=self.scale, bias=self.bias, eps=self._epsilon) def extra_repr(self): - return 'num_features={}, epsilon={}'.format(self.scale.shape[0], + return 'num_features={}, epsilon={}'.format(self._num_features, self._epsilon)