Hey there,
I’m trying to implement a pytorch module that wraps any module and applies the wrapped module’s operation to every time step of the input. This is pretty much the same as Keras’ TimeDistributed wrapper.
To do so, I want to simply reshape the input to two dimensions, apply the operation, and then reshape it back.
However, I’m having troubles doing x_reshape = x.view(-1, x.size(-1)), when the nn.LSTM cell has batch_first=True, which gets me the error:
RuntimeError: input is not contiguous at /Users/soumith/code/pytorch-builder/wheel/pytorch-src/torch/lib/TH/generic/THTensor.c:231
Hopefully, someone here can help me solve this problem…
Cheers