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 2018/11/28 20:37:59 UTC

[GitHub] azai91 commented on a change in pull request #13433: Fix deconvolution / PR 13421

azai91 commented on a change in pull request #13433: Fix deconvolution  / PR 13421
URL: https://github.com/apache/incubator-mxnet/pull/13433#discussion_r237251147
 
 

 ##########
 File path: tests/python/mkl/test_mkldnn.py
 ##########
 @@ -398,6 +398,23 @@ def softmax_forward(input_data, true_output):
     softmax_forward(mx.nd.array([[[[-3.4e38,-3.4e38]]]]), np.array([1.0,1.0]))
     softmax_forward(mx.nd.array([[[[3.4e38,3.4e38]]]]), np.array([1.0,1.0]))
 
+def test_deconvolution_inference():
+    num_filter = 256
+    num_group = 1
+    kernel = (3, 3)
+    pad = (1, 1)
+    shape = (1, 256, 200, 233)
+    x = mx.sym.Variable('x')
+    w = mx.sym.Variable('w')
+    y = mx.sym.Deconvolution(data=x, weight=w, num_filter=num_filter, num_group=num_group, kernel=kernel, no_bias=True, pad=pad)
+    exe = y.simple_bind(ctx=mx.cpu(), x=shape, grad_req='null')
+    exe.arg_arrays[0][:] = np.random.normal(size=exe.arg_arrays[0].shape)
+    exe.arg_arrays[1][:] = np.random.normal(size=exe.arg_arrays[1].shape)
+    for i in range(10):
+        exe.forward(is_train=False)
+        o = exe.outputs[0]
+        t = o.asnumpy()
 
 Review comment:
   you're right. this is only dependent on the shape and not values.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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