gautham-kollu opened a new issue #17471: Gluon Reshape behaves differently for 
NDArray and Symbol
URL: https://github.com/apache/incubator-mxnet/issues/17471
 
 
   ## Description
   Gluon Reshape() behaves differently for NDArray and Symbol.
   NDArray -> Does the reshape IN-place
   Symbol -> Does the reshape Out-of-place
   
   ### Error Message
   (Paste the complete error message. Please also include stack trace by 
setting environment variable `DMLC_LOG_STACK_TRACE_DEPTH=10` before running 
your script.)
   
   ## To Reproduce
   import mxnet  as mx
   from mxnet.gluon import nn
   
   class HybridNet(nn.HybridBlock):
       def __init__(self, **kwargs):
           super(HybridNet, self).__init__(**kwargs)
   
       def hybrid_forward(self, F, x):
           y = x.reshape(-1)
           y = F.square(y, out = y)
           return x+y
   
   
   model = HybridNet()
   model.initialize()
   
   x = mx.nd.array([1,2,3])
   print(model(x))
   
   model.hybridize()
   x = mx.nd.array([1,2,3])
   print(model(x))
   
   ## Running the above on CPU
   [ 2.  8. 18.]
   <NDArray 3 @cpu(0)>
   
   [ 2.  6. 12.]
   <NDArray 3 @cpu(0)>
   
   ### Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   1.
   2.
   
   ## What have you tried to solve it?
   
   1.
   2.
   
   ## Environment
   
   We recommend using our script for collecting the diagnositc information. Run 
the following command and paste the outputs below:
   ```
   curl --retry 10 -s 
https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | 
python
   
   # paste outputs here
   ```
   

----------------------------------------------------------------
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

Reply via email to