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 this 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))
           A = 0.5 <= A
           X = 0.5 <= X
           s = F.batch_dot(A, X)
           return s.sum()
       
   test = Test()
   #test.hybridize()
   test.initialize()
   with autograd.record():
       l = test(inp)
       
   l.backward()
   
   ```
   As stated earlier, calling `hybridize()` will make the error disappear.
   
   Besides, a slight change from `batch_dot` to `dot` 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to