ThomasDelteil commented on a change in pull request #11332: [MXNET-558] Fix 
'AttributeError: '_thread._local' object has no attribute 'value'' on 
distributed processing applications
URL: https://github.com/apache/incubator-mxnet/pull/11332#discussion_r196589704
 
 

 ##########
 File path: tests/python/unittest/test_thread_local.py
 ##########
 @@ -133,6 +133,19 @@ def f():
     thread.join()
     event.clear()
     assert status[0], "Spawned thread isn't using the correct blockscope 
namemanager"
+    
+def test_createblock():
+    status = [False]
+    def f():
+        net = mx.gluon.nn.Dense(2)
+        net.initialize()
+        net(mx.nd.array([1, 2, 3]))
+        status[0] = True
+
+    thread = threading.Thread(target=f)
+    thread.start()
+    thread.join()
+    assert status[0], "Failed to create a layer within a thread"
 
 Review comment:
   Will do :+1: 

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