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

 ##########
 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:
   This is so that any blocks that inherit sequential blocks have this default 
implementation. Child class that have other arguments can choose to override 
this.

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