In your example, hidden[-1]
is the hidden state for the last step, for the last layer.
It is shaped [batch_size, hidden_size]
, so
self.fc3(hidden[-1])
will do fine.
In your example, hidden[-1]
is the hidden state for the last step, for the last layer.
It is shaped [batch_size, hidden_size]
, so
self.fc3(hidden[-1])
will do fine.