apeforest commented on a change in pull request #15059: [MXNET-1410]Adding 
Large Tensor Support for tensor transpose
URL: https://github.com/apache/incubator-mxnet/pull/15059#discussion_r287474024
 
 

 ##########
 File path: tests/nightly/test_large_array.py
 ##########
 @@ -279,6 +279,19 @@ def test_diag():
     assert_almost_equal(r.asnumpy(), np.diag(a_np, k=k))
 
 
+def test_transpose():
+    a = nd.arange(0, LARGE_X).reshape(LARGE_X, 1)
+    b = nd.broadcast_to(a, shape=(a.shape[0], SMALL_Y))
+    t = b.T
+    assert t.shape == (SMALL_Y, LARGE_X)
+    assert np.sum(t[:,-1].asnumpy() == LARGE_X) == b.shape[1]
+    t = nd.swapaxes(b, dim1=0, dim2=1)
+    assert t.shape == (SMALL_Y, LARGE_X)
+    assert np.sum(t[:,-1].asnumpy() == LARGE_X) == b.shape[1]
+    t = nd.flip(b, axis=0)
 
 Review comment:
   try test operator invidually to avoid collateral failures.

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


With regards,
Apache Git Services

Reply via email to