Skip to content

Instantly share code, notes, and snippets.

@3h4
Created November 18, 2016 22:29
Show Gist options
  • Save 3h4/6d41a9f1214d03fb9ba671c6331be5c8 to your computer and use it in GitHub Desktop.
Save 3h4/6d41a9f1214d03fb9ba671c6331be5c8 to your computer and use it in GitHub Desktop.
state_per_layer_list = tf.unpack(init_state, axis=0)
rnn_tuple_state = tuple(
[tf.nn.rnn_cell.LSTMStateTuple(state_per_layer_list[idx][0], state_per_layer_list[idx][1])
for idx in range(num_layers)]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment