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 2017/12/19 21:43:00 UTC

[GitHub] szha commented on a change in pull request #9148: raise warning when we detect Block inside nested list/dict

szha commented on a change in pull request #9148: raise warning when we detect Block inside nested list/dict
URL: https://github.com/apache/incubator-mxnet/pull/9148#discussion_r157883376
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -180,6 +180,22 @@ def __repr__(self):
 
     def __setattr__(self, name, value):
         """Registers parameters."""
+        def _find_block_in_nested(data):
+            # Find whether a nested structure contains Blocks
 
 Review comment:
   This logic looks complicated and doesn't catch the case such as
   ```python
   def __init__(self):
       self.blocks = []
       with self.name_scope():
           for i in range(3):
               self.blocks.append(...)
   ```
   Instead of detecting whether a container has child blocks, you can detect for setattr with containers and give warning that anything in those containers won't be registered.

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