Solved by Keiku in post #2 
              
              
                It turns out that it is possible to remove seq_length without Attention as shown below. 
class CNNLSTM(nn.Module):
    def __init__(
            self,
            num_classes,
            latent_dim=512,
            num_channels=4,
            lstm_layers=1,
            hidden_dim=1024,
            …