How should I build this LSTM model in Pytorch?

On Pytorch, if you want to build a model like this, ⇓normal bi-LSTM
the code will be:

import torch.nn as nn

BLSTM = nn.LSTM(3, 3, bidirectional=True) # input and hidden sizes are example. it doesn't have to be 3.

But I want to build a model like this. ⇓I don't know
This model has two-layerd forward & backward LSTM.

My question is how to build this model in Pytorch.


The code I can think of is this:

import torch.nn

BLSTM = nn.LSTM(3, 3, 2, bidirectional=True) # input and hidden sizes are example. it doesn't have to be 3.

I thought it’s wrong because this ⇓ would be the model if I used this code.
cat
I feel that this model is a little different from the model I want to build.