piiswrong commented on a change in pull request #10833: [WIP] Change class 
variables to thread local variables
URL: https://github.com/apache/incubator-mxnet/pull/10833#discussion_r186508754
 
 

 ##########
 File path: python/mxnet/attribute.py
 ##########
 @@ -64,15 +65,15 @@ def get(self, attr):
 
     def __enter__(self):
         # pylint: disable=protected-access
-        self._old_scope = AttrScope.current
-        attr = AttrScope.current._attr.copy()
+        self.save_local_var()
+        attr = AttrScope.local.current._attr.copy()
         attr.update(self._attr)
         self._attr = attr
-        AttrScope.current = self
+        self.set_local_var()
         return self
 
     def __exit__(self, ptype, value, trace):
-        assert self._old_scope
-        AttrScope.current = self._old_scope
 
 Review comment:
   AttrScope.current.value = self._old_scope

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