A naive question about stacked RNN

Can anyone give a proper explanation, what’s the difference between them:
Are they doing the same thing to complete stacking RNN?

pesudo Keras code:

in=Input()
x=LSTM(seq=True)(in)
x=LSTM()(x) 
cells = []
cell1 = LSTMCell(some units)
cells.append(cell1)
cell2 = LSTMCell(some units)
cells.append(cell2)
stacked_lstm =  StackedRNNCells(cells)
RNN(stacked_lstm ,seq=True, rt-state=True)

thank you

@ChrisXY_Zhao,

Yes, both are examples of a stacked LSTM model.

in=Input()
x=LSTM(seq=True)(in)
x=LSTM()(x)

Here two LSTM layers are stacked on top of each other. The first LSTM layer takes the input data and the second LSTM layer takes the output of the first LSTM layer as input.

cells = []
cell1 = LSTMCell(some units)
cells.append(cell1)
cell2 = LSTMCell(some units)
cells.append(cell2)
stacked_lstm =  StackedRNNCells(cells)
RNN(stacked_lstm ,seq=True, rt-state=True)

Here first defines two LSTM cells with the specified number of units, then creates a list of these cells and passes them to the StackedRNNCells function, which creates a stacked RNN cell. Finally, the RNN function is used to create the RNN model with the stacked cell, and the seq and return_state parameters are set to True.

Thank you!