hi Adam,
how do we detach the states from the output of GRU layer:
def detach_states(self, states):
	if states is None:
		return states
	return [state.detach() for state in states]

 are output from the GRU layer. When I pass them to

self.gru(X, initial_states)

It gives me following error: …

File “/Users/user_name/anaconda/lib/python3.5/site-packages/torch/nn/modules/rnn.py”, line 162, in check_forward_args
check_hidden_size(hidden, expected_hidden_size)
File “/Users/user_name/anaconda/lib/python3.5/site-packages/torch/nn/modules/rnn.py”, line 153, in check_hidden_size
if tuple(hx.size()) != expected_hidden_size:
AttributeError: ‘list’ object has no attribute ‘size’

What I am doing wrong. I can put the entire code if this is not clear.