This is an automated email from the ASF dual-hosted git repository.

haibin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b30af2  enable CPU kernel for all RNN layer forward (#11807)
9b30af2 is described below

commit 9b30af2c6cfbb868ff15e4da59fb8d030808b830
Author: Sheng Zha <[email protected]>
AuthorDate: Wed Jul 18 21:08:50 2018 -0700

    enable CPU kernel for all RNN layer forward (#11807)
---
 python/mxnet/gluon/rnn/rnn_layer.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/python/mxnet/gluon/rnn/rnn_layer.py 
b/python/mxnet/gluon/rnn/rnn_layer.py
index cda9138..418c497 100644
--- a/python/mxnet/gluon/rnn/rnn_layer.py
+++ b/python/mxnet/gluon/rnn/rnn_layer.py
@@ -185,11 +185,7 @@ class _RNNLayer(Block):
             for i in range(self._dir):
                 self.i2h_weight[i].shape = (self._gates*self._hidden_size, 
inputs.shape[2])
                 self.i2h_weight[i]._finish_deferred_init()
-        if inputs.context.device_type == 'gpu' or \
-           self._mode in ['lstm', 'gru'] and not self._dropout:
-            out = self._forward_kernel(inputs, states)
-        else:
-            out = self._forward(inputs, states)
+        out = self._forward_kernel(inputs, states)
 
         # out is (output, state)
         return out[0] if skip_states else out

Reply via email to