Week 1 Assignment 1 lstm_forward TypeError

I am getting this error for lstm_forward and I’m not sure why. Help will be appreciated!

You probably fetch shapes incorrectly:

    # Retrieve dimensions from shapes of x and parameters['Wy'] (≈2 lines)

i.e., n_a, m, and T_x have the wrong values.

Also your initialization of c and y are incorrect.


when it is a 3D aaray we implement like this

Yes, that’s correct. But I think the problem for the student who posted this thread was that one of the elements of the array was not a scalar integer (e.g. was an array itself or perhaps a float value).