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/03/24 02:26:07 UTC

[GitHub] lightingghost commented on issue #10220: Check failed: !ndinputs.back()->is_none()

lightingghost commented on issue #10220: Check failed: !ndinputs.back()->is_none()
URL: https://github.com/apache/incubator-mxnet/issues/10220#issuecomment-375840105
 
 
   Here is a minimum sample to reproduce the error
   ```python
   
   import mxnet as nd
   from mxnet import nd, sym, autograd
   from mxnet import gluon as g
   
   inp = nd.ones((20, 10))
   class Test(g.nn.HybridBlock):
       def __init__(self):
           super(Test, self).__init__()
           self.fc1 = g.nn.Dense(100)
           self.fc2 = g.nn.Dense(20)
           
       def hybrid_forward(self, F, x):
           A = self.fc1(x)
           X = self.fc2(x)
           A = A.reshape((-1, 10, 10))
           X = X.reshape((-1, 10, 2))
           return A, X
       
   test = Test()
   #test.hybridize()
   test.initialize()
   with autograd.record():
       A, X = test(inp)
       A = 0.5 <= A
       X = 0.5 <= X
       s = nd.batch_dot(A, X)
       l = s.sum()
       
   l.backward()
   
   ```
   As stated earlier, calling `hybridize()` will make the error disappear.

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