Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
enable CPU kernel for all RNN layer forward (#11807)
Browse files Browse the repository at this point in the history
  • Loading branch information
szha authored and eric-haibin-lin committed Jul 19, 2018
1 parent 1031fe1 commit 9b30af2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions python/mxnet/gluon/rnn/rnn_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,7 @@ def forward(self, inputs, states=None):
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
Expand Down

0 comments on commit 9b30af2

Please sign in to comment.