haojin2 commented on a change in pull request #14869: Fix infer shape partial after unknown shape changed to -1 URL: https://github.com/apache/incubator-mxnet/pull/14869#discussion_r284496546
########## File path: src/operator/tensor/dot-inl.h ########## @@ -1207,6 +1207,12 @@ inline bool DotShape(const nnvm::NodeAttrs& attrs, CHECK_EQ(out_attrs->size(), 1U); mxnet::TShape& lshape = (*in_attrs)[0]; mxnet::TShape& rshape = (*in_attrs)[1]; + // return false if lhs and rhs both have fully unknown shape + if (!ndim_is_known(lshape) || !ndim_is_known(rshape)) return false; + // only partially infer shape if last dim of lhs and first dim of rhs is known + bool last_dim_known = dim_size_is_known(lshape, lshape.ndim() > 1 ? lshape.ndim() - 1 : 0); + bool first_dim_known = dim_size_is_known(rshape, 0); Review comment: Better check if rshape has more than 1 dim? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
