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/06/04 11:04:50 UTC

[GitHub] marcoabreu commented on a change in pull request #10921: [MXNET-500]Test cases improvement for MKLDNN on Gluon

marcoabreu commented on a change in pull request #10921: [MXNET-500]Test cases improvement for MKLDNN on Gluon
URL: https://github.com/apache/incubator-mxnet/pull/10921#discussion_r192703164
 
 

 ##########
 File path: tests/python/unittest/test_gluon.py
 ##########
 @@ -1146,6 +1147,1046 @@ def test_summary():
     assert_raises(AssertionError, net.summary, mx.nd.ones((32, 3, 224, 224)))
 
 
+def check_layer_forward_withinput(net, x):
+    x_hybrid = x.copy()
+    x.attach_grad()
+    x_hybrid.attach_grad()
+    net.collect_params().initialize()
+    with mx.autograd.record():
+        out1 = net(x)
+    out1.backward()
+    net.hybridize()
+    with mx.autograd.record():
+        out2 = net(x_hybrid)
+    out2.backward()
+    mx.test_utils.assert_almost_equal(x.grad.asnumpy(), x_hybrid.grad.asnumpy(), rtol=1e-5, atol=1e-6)
+    mx.test_utils.assert_almost_equal(out1.asnumpy(), out2.asnumpy(), rtol=1e-5, atol=1e-6)
+
+@with_seed()
+def test_conv2d_mkldnn():
 
 Review comment:
   remove mkldnn in name?

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