you can collect these two LSTMs into a single class and use DataParallel on it.
Does that help?
import torch.nn as nn
class TwoLSTMs(nn.Module):
    def __init__(self):
        self.rnn_one = nn.LSTM(input_size=10, hidden_size=20, num_layers=2)
        self.rnn_two = nn.LSTM(input_size=20, hidden_size=2)
   
    def forward(self, inp, h0, c0):
        output, (hn, cn) = rnn(inp, (h0, c0))
        output2, _ = rnn_two(output)
        return output2


model = TwoLSTMs()
model = nn.DataParallel(model)

P.S: I did not check for syntax errors