The nn.LSTM module expects inputs as:



input of shape (seq_len, batch, input_size): tensor containing the features of the input sequence. The input can also be a packed variable length sequence. See torch.nn.utils.rnn.pack_padded_sequence() 1 or torch.nn.utils.rnn.pack_sequence() 1 for details.

h_0 of shape (num_layers * num_directions, batch, hidden_size): tensor containing the initial hidden state for each element in the batch. If the LSTM is bidirectional, num_directions should be 2, else it should be 1.

c_0 of shape (num_layers * num_directions, batch, hidden_size): tensor containing the initial cell state for each element in the batch.If (h_0, c_0) is not provided, both h_0 and c_0 default to zero.


as given in the docs 3.
Also note, that the default input shapes have the temporal dimension in dim0, so you might want to permute the x tensor coming from exec_conv_block. Alternatively, you could also use batch_first=True in the LSTM creation, which would then expect the input in the shape [batch_size, seq_len, nb_features].
The hidden and cell stats are expected in the shape [num_layers*num_directions, batch_size, hidden_size], so your current workflow of passing the states from lstm1 to lstm2 won’t work, since the hidden_size is different.
If you don’t pass the hidden states to the module, it’ll initialize them with zeros.