Error in the pool forward function Week1, Assignement 1

Within the loop that iterates over the channels, if I put a ’ : ’ at the end, I get wrong output in 2 of the 6 test cases. But if I replace the colon with ‘c’, the iterator of the loop, i get “all test cases passed”. I can’t understand what is happenning in the case when I am putting a colon at the end. Why am I getting wrong outputs in that case?

Code snippet:
a_prev_slice = A_prev[i,vert_start:vert_end, horiz_start:horiz_end, :]

When you put a : at the end, you consider all channels of the slice. Pooling is done for each slice per channel. This is why you need to have c at the end.