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

Commit

Permalink
set __layout__ attr for FucedRNNCell output states
Browse files Browse the repository at this point in the history
  • Loading branch information
formath committed Jun 19, 2017
1 parent 46e5dfb commit c1fd788
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/mxnet/rnn/rnn_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,11 @@ def unroll(self, length, inputs, begin_state=None, layout='NTC', merge_outputs=N
if not self._get_next_state:
outputs, states = rnn, []
elif self._mode == 'lstm':
rnn[1]._set_attr(__layout__='LNC')
rnn[2]._set_attr(__layout__='LNC')
outputs, states = rnn[0], [rnn[1], rnn[2]]
else:
rnn[1]._set_attr(__layout__='LNC')
outputs, states = rnn[0], [rnn[1]]

if axis == 1:
Expand Down

0 comments on commit c1fd788

Please sign in to comment.