DLS4, W1, ex3 conv_forward

Hi all, I am struggling with this function…what should be shapes of parameters ?

Mine are like this :
a_prev_pad (7, 9, 4)
a_slice_prev (3, 3, 4)
W (3, 3, 4)
b (1, 1, 1)

For loop goes 13th times then failed :

ERROR MESSAGE:
—> 85 Z[i, h, w, c]= conv_single_step()

IndexError: index 3 is out of bounds for axis 2 with size 3

Does anybody know where should be the problem ?

Nevermind, found where I hade mistake in vert_start and horz_start…shapes were correct

Glad you found the solution! Yes, the “stride” is the trickiest thing in conv_forward and pool_forward.