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 2019/10/25 18:20:07 UTC

[GitHub] [incubator-mxnet] szha commented on a change in pull request #16582: [Gluon] Don't serialize shared parameters twice

szha commented on a change in pull request #16582: [Gluon] Don't serialize shared parameters twice
URL: https://github.com/apache/incubator-mxnet/pull/16582#discussion_r339180564
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -510,15 +524,26 @@ def load_parameters(self, filename, ctx=None, allow_missing=False,
 
         if not any('.' in i for i in loaded.keys()):
             # legacy loading
-            del loaded
+            loaded = None
+            # We cannot `del loaded` as it is used in a generator expression
+            # below. `del loaded` would be a SyntaxError in Python 2.
 
 Review comment:
   this comment is confusing as it comments on code that doesn't exist.
   
   in general, comments should be minimal, and concise, and only out of necessity. code should be self-documenting.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services