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/05/11 07:19:30 UTC

[GitHub] anirudh2290 commented on issue #10833: Change class variables to thread local variables

anirudh2290 commented on issue #10833: Change class variables to thread local variables
URL: https://github.com/apache/incubator-mxnet/pull/10833#issuecomment-388282516
 
 
   Recording some of the offline conversation: Initially the inheritance and metaclasses was for allowing code reuse of thread local code easily for multiple modules. This code was a bit complicated to understand so we moved the `threading.local` calls to module where it was needed instead of using inheritance and metaclasses for threadlocal. For adding backward compatibility, we have to make `default_ctx` and equivalents in other modules class properties. This required adding logic in base.py for the same. This included adding a metaclass and since metaclass syntax is not the same between python2 and python3 needed to use six. We cannot add six as a dependency, because that restricts users more, and thus we copied the metaclass specific code from six into base.py.

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