hzfan commented on a change in pull request #17749: Fix races in block scope
and deferred_init
URL: https://github.com/apache/incubator-mxnet/pull/17749#discussion_r387592912
##########
File path: python/mxnet/gluon/block.py
##########
@@ -48,8 +48,9 @@ class _BlockScope(object):
def __init__(self, block):
self._block = block
self._counter = {}
- self._old_scope = None
- self._name_scope = None
+ self._local = threading.local()
Review comment:
Thanks for sharing this. Do we have a plan to switch to contextvars in the
near future? This pr focuses on the _BlockScope issue. Maybe we can switch all
threading.local() to contextvars in another pr.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services