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/04/20 20:40:16 UTC

[GitHub] piiswrong commented on a change in pull request #10630: make the slice of sequential a sequential

piiswrong commented on a change in pull request #10630: make the slice of sequential a sequential
URL: https://github.com/apache/incubator-mxnet/pull/10630#discussion_r183164014
 
 

 ##########
 File path: python/mxnet/gluon/nn/basic_layers.py
 ##########
 @@ -62,7 +62,15 @@ def __repr__(self):
                         modstr=modstr)
 
     def __getitem__(self, key):
-        return list(self._children.values())[key]
+        layers = list(self._children.values())[key]
+        if isinstance(layers, list):
+            with self.name_scope():
+                net = type(self)()
 
 Review comment:
   why type(self)? There is no guarantee that type(self)'s constructor accepts no arguments

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