Week 1 Assignment 1 Exercise 4: Pool Forward

I have tried to figure this out for the last 2 days but couldn’t so ask about it. What is wrong with my code that is not able to pass the tests.

{moderator edit - solution code removed}

np.random.seed(1)
A_prev = np.random.randn(2, 5, 5, 3)
hparameters = {“stride” : 1, “f”: 2}

A, cache = pool_forward(A_prev, hparameters, mode = “max”)

When you do the slicing, you have reversed the h and w ranges. h stands for “height” not for “horizontal”.

I thought so but couldn’t figure this out. Thanks a ton! m,makes me feel much better