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 2020/12/03 23:25:23 UTC

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #19271: Added tests for convolution layer with large inputs

leezu commented on a change in pull request #19271:
URL: https://github.com/apache/incubator-mxnet/pull/19271#discussion_r535720318



##########
File path: tests/nightly/test_np_large_array.py
##########
@@ -2345,3 +2349,27 @@ def test_insert():
     assert out[0, 1] == 1 and out[-1, 1] == 2
     assert out2[1] == 5 and out2[2] == 6
     assertRaises(MXNetError, np.insert, arr=inp3, obj=np.array([2, 2], dtype=np.int64), values=np.array([5, 6]))
+
+@pytest.mark.skip(reason='times out (20 mins)')
+def test_convolution():
+    dim = 2
+    batch_size = 1
+    channel = 3
+    height = SMALL_Y
+    width = LARGE_X // 3
+    num_filter = 4
+    kernel = (3,) * dim   # => shape = (3, 3)
+
+    inp=mx.np.ones(shape=(batch_size, channel, height, width))
+    weight = mx.np.ones(shape=(num_filter, channel, kernel[0], kernel[1]))
+    bias = mx.np.array(num_filter,)
+    inp.attach_grad()
+    with mx.autograd.record():
+        out = mx.npx.convolution(data=inp, weight=weight, num_filter=num_filter, \
+                                 kernel=kernel, no_bias=True)

Review comment:
       You could specify a stride to reduce the computational complexity and speed up the test?




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