*{moderator edit - solution code removed}*

This is my code and it produces the following error. Please anyone help me

*{moderator edit - solution code removed}*

This is my code and it produces the following error. Please anyone help me

The problem is that you are specifying the wrong “input channel” when you compute the “slice” of *A_prev_pad*. The error points right at that line and that index value, right? Think about what is happening when we do the “conv single step” operation: the loops here are over the *output* space and we must touch every position. Then at each output position we do the “single step” with the output filter c and it has dimension f x f x nC_{prev}. With A_prev_pad we are choosing exactly where in the input space we apply the filter and the point is that we need all those *input* channel values, right? So how do you say “use all values” for a given index position in python?