-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[BUGFIX] fix unknown parameter shapes when np_shape is turned on. #15097
Conversation
I think the following two places checking whether the shape is known should be modified too. |
I'm worried about this line Users may notice that we started to use all(j in (-1, 0, i) for i, j in zip(new_shape, self._shape)) when @szha What do you think? |
@mxnet-label-bot add [Gluon] |
@reminisce I had similar concern though I thought the API doc should do the job. another option is to expose an internal interface for infer_shape to use, instead of piggybacking on the |
@reminisce @szha @zheng-da what's the next step here? There is nothing to prevent users from using |
I think it would be safer to note |
where should we document |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe for NP shape APIs, it's already documented as experimental, so just add some comments in this PR about -1 and refer to the np documentation here /~https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/util.py#L84
…ache#15097) * fix. * add test. * fix test. * check unknown shape correctly. * fix test. * fix. * fix. * add more comments. * add doc.
Description
When np_shape is turned on, the unknown parameter shapes should be -1 instead of 0. So when a parameter is created but isn't initialized, the dimension of unknown size is -1 when np_shape is turned on, and is 0, otherwise.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.