Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix shape inference bug #7682

Merged
merged 1 commit into from Aug 31, 2017
Merged

Conversation

reminisce
Copy link
Contributor

@reminisce reminisce commented Aug 31, 2017

This PR fixes a shape inference bug in function InferAttr.
Consider the following network:

weight --> abs_op --> sum_op 
       \                    \ 
        \                     add_op
         \                  /
data   --> fc_op --> sum_op

Given a data shape, if the shape forward inference starts from weight, there would be several node entries with unknown shapes for abs_op and sum_op in the first pass. The weight shape is only known after fc_op's shape inference is done. When the backward shape inference starts, it assumes that all forward node entries' shapes are known. However, this is not true in this case and therefore, leads to CHECK_EQ failure.

The problem is fixed by skipping CHECK_EQ for empty shapes in the backward shape inference.

@piiswrong @eric-haibin-lin

@piiswrong piiswrong merged commit 6d71577 into apache:master Aug 31, 2017
mbaijal pushed a commit to mbaijal/incubator-mxnet that referenced this pull request Sep 6, 2017
cjolivier01 pushed a commit to cjolivier01/mxnet that referenced this pull request Sep 11, 2017
@tqchen
Copy link
Member

tqchen commented Sep 18, 2017

@reminisce Can you also backport this to nnvm?

@reminisce
Copy link
Contributor Author

@tqchen I will do that. Thanks.

crazy-cat pushed a commit to crazy-cat/incubator-mxnet that referenced this pull request Oct 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants