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 2019/07/17 04:05:49 UTC

[GitHub] [incubator-mxnet] hzfan opened a new issue #15563: [numpy] np.tensordot fails with 0-size tensor

hzfan opened a new issue #15563: [numpy] np.tensordot fails with 0-size tensor
URL: https://github.com/apache/incubator-mxnet/issues/15563
 
 
   ## Description
   np.tensordot does not work with 0-size tensor
   
   ## Environment info
   python 3.7.3
   
   ## Minimum reproducible example
   
   ```
   import mxnet as mx
   import numpy as _np
   from mxnet import np, npx
   a_np = _np.empty((0, 4))
   b_np = _np.empty((5, 0))
   ret = _np.tensordot(a_np, b_np, axes=((0,), (1,)))
   print(ret)
   npx.set_np()
   a = np.empty((0, 4))
   b = np.empty((5, 0))
   a.attach_grad()
   b.attach_grad()
   with mx.autograd.record():
     ret = np.tensordot(a, b, axes=((0, ), (1, )))
   ret.backward()
   print(ret)
   print(a.grad)
   print(b.grad)
   ```
   
   The result is
   `[[0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]]
   
   Intel MKL ERROR: Parameter 9 was incorrect on entry to cblas_sgemm.
   [[0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]
    [0. 0. 0. 0. 0.]]
   []
   []
   `
   
   Thank @ckt624 @reminisce for kind help.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services