C5W1A3 - Why not use LSTMCell()?

I read the code of LSTM() and LSTMCell() of Keras on Github.
In the description of LSTMCell class, they say:

This class processes one step within the whole time sequence input, whereas
tf.keras.layer.LSTM processes the whole sequence."

So does it mean that the use of LSTM() to process one time step in the exercise is wrong?
P/S: I found the same question in the discussion but it hasn’t been answered yet. So i posted another one.
Thank you for reading!

1 Like

LSTMCell() processes a single time-step. You have to call it once for each time step in your data set.

LSTM() does that all for you.

They both operate on the time steps in sequence. You just have to do more of the work yourself with LSTMCell().

1 Like

If “LSTM() does all that for you” were correct, I wonder why we still have to use for loop to step over each time step in the exercise (see djmodel() function).
After further examination, although LSTM() in the exercise indeed processes all timestep, we only feed it with 1 time step every for iteration. So I guess the use of LSTM() here is similar to LSTMCell(). Please correct me if I’m wrong. Thank you!

I think you are correct.