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/06/29 21:14:49 UTC

[GitHub] szha commented on a change in pull request #11482: make gluon rnn layers hybrid blocks

szha commented on a change in pull request #11482: make gluon rnn layers hybrid blocks
URL: https://github.com/apache/incubator-mxnet/pull/11482#discussion_r199281929
 
 

 ##########
 File path: python/mxnet/gluon/rnn/rnn_layer.py
 ##########
 @@ -173,67 +177,63 @@ def begin_state(self, batch_size=0, func=ndarray.zeros, **kwargs):
             states.append(func(name='%sh0_%d'%(self.prefix, i), **info))
         return states
 
-    def forward(self, inputs, states=None):
-        batch_size = inputs.shape[self._layout.find('N')]
+    def hybrid_forward(self, F, inputs, states=None, **kwargs):
+        if F is ndarray:
+            batch_size = inputs.shape[self._layout.find('N')]
+            if self._input_size == 0:
 
 Review comment:
   this is not possible due to the inverse shape inference in concat.

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