Hi, does anyone know how to implement the following structure in pytorch.

The problem is, LSTMs (Decoder) accepts input as Batch_Size x Seq_length x Input_size whereas convolution neural network (Encoder) takes input as Batch_Size x Input_size. Is there any way to give input to the CNN encoder as Batch_Size x Seq x Input size and get an output as Batch_size x Seq_length x output_size and use this output to feed into LSTM? I was able to do this in Torch using sequencers but I don’t know how to do this in pytorch.