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/08/15 16:12:40 UTC

[GitHub] sandeep-krishnamurthy commented on a change in pull request #12167: Add test to check that binded is not set when exception thrown

sandeep-krishnamurthy commented on a change in pull request #12167: Add test to check that binded is not set when exception thrown
URL: https://github.com/apache/incubator-mxnet/pull/12167#discussion_r210322310
 
 

 ##########
 File path: tests/python/unittest/test_module.py
 ##########
 @@ -44,6 +44,18 @@ def test_module_dtype():
       assert x.dtype == dtype
 
 
+def test_module_bind():
+    sym = mx.sym.Variable('data')
+    sym = mx.sym.Activation(data=sym, act_type='relu', __layout__='TNC')
+
+    mod = mx.mod.Module(sym, ('data',), None, context=[mx.cpu(0), mx.cpu(1)])
+    assertRaises(TypeError, mod.bind, data_shapes=[('data', mx.nd.array([10,10]))])
+    mod.binded = False
+
+    mod.bind(data_shapes=[('data', (10,10))])
+    mod.binded = True
 
 Review comment:
   you intended assert mod.binded == True?

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