Skip to content

Instantly share code, notes, and snippets.

Created March 26, 2019 09:39
What would you like to do?
Create an RNN Cell and initialize it
def get_init_cell(batch_size, rnn_size):
lstm = tf.contrib.rnn.GRUCell(rnn_size)
cell = tf.contrib.rnn.MultiRNNCell([lstm])
initial_state = tf.identity(cell.zero_state(batch_size, tf.float32), name='initial_state')
return cell, initial_state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment