Week 1 Assignment 1 problem with the dimensions

I am facing this issue. Getting error as

here is the code snippet

{moderator edit - solution code removed}

I think the problem is when you “slice” the W and b values. There are two problems there:

  1. You are overwriting the base values, which will cause problems once you get to the second iteration after you fix the next bug:
  2. Those arrays have 4 dimensions, but you are slicing on the 3rd dimension. That is the “old channel” dimension.

Thanks Sir! That worked
But sir would you tell why overwriting base values could raise an error like this?

That will cause a different error: on the next iteration, the value will be the previous “sliced” value, not the original value to be “resliced”. But (as I commented) you never get to the second iteration because of the second bug.