From 21366a92d0f2230162b8225db6c5140b04f990dc Mon Sep 17 00:00:00 2001 From: TianYuan Date: Wed, 29 Dec 2021 12:58:59 +0800 Subject: [PATCH] fix extra_repr in _InstanceNormBase, test=develop (#38537) --- python/paddle/nn/layer/norm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/nn/layer/norm.py b/python/paddle/nn/layer/norm.py index b0e0fe3234..de9f8663e6 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) -- GitLab