access2rohit commented on a change in pull request #16476: added large tensor 
support for add_n and tests for more ops
URL: https://github.com/apache/incubator-mxnet/pull/16476#discussion_r335789956
 
 

 ##########
 File path: tests/nightly/test_large_vector.py
 ##########
 @@ -708,6 +709,57 @@ def test_full():
     assert a[-1] == 3
 
 
+def test_load_save():
+    x = create_vector(size=LARGE_X)
+    nd.save('large_vector', [x])
+    y = nd.load('large_vector')
+    y = y[0]
+    assert x[0] == y[0]
+    assert x[-1] == y[-1]
+    os.remove('large_vector')
+
+
+def test_add_n():
+    x = [nd.ones(LARGE_X)]
+    y = nd.add_n(*x)
+    assert y[0] == 1
+    assert y[-1] == 1
+
+
+def test_modulo():
+    x = mx.nd.ones(LARGE_X)*6
+    y = mx.nd.ones(LARGE_X)*4
+    z = (x%y)
+    assert z[0] == 2
+    assert z[-1] == 2
+    x = mx.nd.ones(LARGE_X)*5
+    z = nd.modulo(x,y)
+    assert z[0] == 1
+    assert z[-1] == 1
+
+
+def test_maximum():
+    x = mx.nd.ones(LARGE_X)*3
+    y = mx.nd.ones(LARGE_X)*4
+    z = nd.maximum(x, y)
+    assert z[0] == 4
+    assert z[-1] == 4
+    z = nd.maximum(x, 5)
+    assert z[0] == 5
+    assert z[-1] == 5
+
+
+def test_minimum():
+    x = mx.nd.ones(LARGE_X)*3
+    y = mx.nd.ones(LARGE_X)*2
+    z = nd.minimum(x, y)
+    assert z[0] == 2
+    assert z[-1] == 2
+    z = nd.minimum(x, 5)
+    assert z[0] == 3
+    assert z[-1] == 3
 
 Review comment:
   Only forward passes are required by DGL

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