Not able to understand the error

[code removed - moderator]

error

ndexError Traceback (most recent call last)
in
6 “stride”: 2}
7
----> 8 Z, cache_conv = conv_forward(A_prev, W, b, hparameters)
9 z_mean = np.mean(Z)
10 z_0_2_1 = Z[0, 2, 1]

in conv_forward(A_prev, W, b, hparameters)
78 a_slice_prev = a_prev_pad[vert_start:vert_end, horiz_start:horiz_end, :]
79 # Convolve the (3D) slice with the correct filter W and bias b, to get back one output neuron. (≈1 line)
—> 80 Z[i, h, w, c] = conv_single_step(a_slice_prev, W[:,:,:,c], b[:,:,:,c])
81 # print(W.shape[c],b.shape[c])
82 # return

IndexError: too many indices for array

Please ensure that Z has 4 dimensions.