D5W1 A1 Assignment Exercise 7 LSTM Backward Pass need help

I am trying to implement D5W1 A1 Assignment Exercise 7 " LSTM Backward Pass" but got stuck in understanding this part in parameter derivates

Parameter Derivatives


The instruction here appear to ask us to concatenate the matrix a_prev with xt. but they are of different size and once I done that the following numpy error appears.

TypeError Traceback (most recent call last)
19 da_next_tmp = np.random.randn(5,10)
20 dc_next_tmp = np.random.randn(5,10)
β€”> 21 gradients_tmp = lstm_cell_backward(da_next_tmp, dc_next_tmp, cache_tmp)
22 print(β€œgradients["dxt"][1][2] =”, gradients_tmp[β€œdxt”][1][2])
23 print(β€œgradients["dxt"].shape =”, gradients_tmp[β€œdxt”].shape)

in lstm_cell_backward(da_next, dc_next, cache)
46 print (a_prev.shape)
47 print (xt.shape)
β€”> 48 concat = np.concatenate(a_prev, xt)
49 print (concat.shape)
50 dWf = np.dot(dft, (np.concatenate(a_prev, xt)).T)

<array_function internals> in concatenate(*args, **kwargs)

TypeError: only integer scalar arrays can be converted to a scalar index

For debugging purpose the shape of a_prev and xt are:

(5, 10)
(3, 10)

My lab ID is pahlbtkn