Categories
Development

Hidden state tensors have a different order than the returned tensors

As part of GRU training, I want to retrieve the hidden state tensors. I have defined a GRU with two layers: self.lstm = nn.GRU(params.vid_embedding_dim, params.hidden_dim , 2) The forward function is defined as follows (the following is just a part of the implementation): def forward(self, s, order, batch_size, where, anchor_is_phrase = False): “”” Forward prop. […]