From 14aeb384a51c9e420c349f42cea001f0a5ef5dfe Mon Sep 17 00:00:00 2001 From: RuRo Date: Fri, 19 Jun 2020 01:16:12 +0300 Subject: [PATCH] Add parameter name to AssertionError for deferred shape inference (#18537) --- python/mxnet/gluon/parameter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mxnet/gluon/parameter.py b/python/mxnet/gluon/parameter.py index 9600d8337a0a..9f6f540f3a7f 100644 --- a/python/mxnet/gluon/parameter.py +++ b/python/mxnet/gluon/parameter.py @@ -194,8 +194,8 @@ def shape(self, new_shape): assert len(self._shape) == len(new_shape) and \ all(j in (-1, 0, i) for i, j in zip(new_shape, self._shape)), \ - "Expected shape %s is incompatible with given shape %s."%( - str(new_shape), str(self._shape)) # -1 means unknown dim size in np_shape mode + "Expected shape %s is incompatible with given shape %s for Parameter %s."%( + str(new_shape), str(self._shape), str(self.name)) # -1 means unknown dim size in np_shape mode self._shape = new_shape