juliusshufan commented on a change in pull request #10921: Test cases 
improvement for MKLDNN on Gluon
URL: https://github.com/apache/incubator-mxnet/pull/10921#discussion_r188160329
 
 

 ##########
 File path: tests/python/mkl/test_mkldnn.py
 ##########
 @@ -29,6 +29,21 @@
 sys.path.append(os.path.join(curr_path, '../unittest/'))
 from common import with_seed
 
+def check_layer_forward(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)
+        print out2
+    out2.backward()
 
 Review comment:
   @zheng-da , my understanding is the comparison already between with 
hybridize and w.o hybridize.
   "out1" is based on the network not hybridzied, and with x.copy, I set 
x_hybrid as the hybridized network at line 40 and compute as out2. Is it 
expected?
   

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


With regards,
Apache Git Services

Reply via email to