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.…

Discover more

Why does the Eclipse CDT code formatter sometimes introduce spaces in template arguments?

I am using Eclipse 4.12.0 and Eclipse CDT 9.8.1 and I am writing C++ code that uses std::tuple. Sometimes the code formatter introduces extra spaces in my code where I retrieve entries of tuples. Please consider the following example file: #include <tuple> int main(int, char**) { std::tuple<int, int> myTuple; // First important line std::get<0>(myTuple) =…

Discover more