You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/18 03:50:36 UTC

[GitHub] szha commented on issue #9288: Get HybridBlock layer shape on runtime

szha commented on issue #9288: Get HybridBlock layer shape on runtime
URL: https://github.com/apache/incubator-mxnet/issues/9288#issuecomment-358529606
 
 
   `infer_shape` might have been a misnomer because what it does is actually inferring the shapes of parameters, and what you expect as well as the `infer_shape` that symbol provides is for inferring output shape.
   
   In general, in HybridBlock you shouldn't depend on the exact shape of input, because otherwise it indicates that the computation graph may change depending on the shape, thus rendering it unsuitable for HybridBlock. That said, there are plenty of ways to get around the dependency on the exact value of shape (e.g. [special placeholders in reshape](https://mxnet.incubator.apache.org/versions/master/api/python/symbol/symbol.html?highlight=reshape#mxnet.symbol.reshape), `XX_like` operators such as [zeros_like](https://mxnet.incubator.apache.org/versions/master/api/python/symbol/symbol.html?highlight=reshape#mxnet.symbol.zeros_like)).
   
   If you could share exactly how you depend on the shape, others and I might be able to help more.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services