You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/13 21:16:56 UTC

[GitHub] mli commented on a change in pull request #7877: improve layer slicing

mli commented on a change in pull request #7877: improve layer slicing
URL: https://github.com/apache/incubator-mxnet/pull/7877#discussion_r138742077
 
 

 ##########
 File path: python/mxnet/gluon/nn/basic_layers.py
 ##########
 @@ -94,8 +123,18 @@ def __repr__(self):
         return s.format(name=self.__class__.__name__,
                         modstr=modstr)
 
-    def __getitem__(self, i):
-        return self._children[i]
+    def __getitem__(self, key):
+        if isinstance(key, integer_types):
+            return self._children[key]
+        elif isinstance(key, py_slice):
+            out = HybridSequential(self._prefix, self._params)
+            for c in self._children[key]:
 
 Review comment:
   why it is problematic
 
----------------------------------------------------------------
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