You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by GitBox <gi...@apache.org> on 2020/03/25 04:50:16 UTC

[GitHub] [singa] joddiy edited a comment on issue #634: cannot do matmul for high-dim tensors

joddiy edited a comment on issue #634: cannot do matmul for high-dim tensors
URL: https://github.com/apache/singa/issues/634#issuecomment-603638731
 
 
   Hi, shicong, according to the np's definition, the matmul for high-dim matrix should be:
   
   ```python3
   x1 = np.random.randn(1, 12, 256, 64).astype(np.float32)
   x2 = np.random.randn(1, 12, 64, 256).astype(np.float32)
   print(np.matmul(x1, x2).shape)
   ```
   
   Output:
   > (1, 12, 256, 256)
   
   Actually, it does the matmul for (256, 64) * (64, 256) for all cells of the first two axes (1, 12).

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