Course 1 - week 4 Ex-9 L_model backward : I can't figure out why is this error

This is my error…

The output with wrong results:

Expected was:

Since in dW1 shown in test , only second row is incorrect,
I have deduced that the error is due to the second row of dZ , which is calculated in

{moderator edit - solution code removed}

but all previous cells in this assignment have been verified.
Still the dA used to calculate dZ is also correct because dA1 appears correctly in the test.
How I am i getting this error?

This only one row/column is wrong in a matrix - type error always makes me stuck… :frowning:
This is my wrk(code)

{moderator edit - solution code removed}

I think the problem is that you are manually writing out what the relu_backward function does, but you missed some of the subtleties there. They gave you that function: why not just call it? You can examine the source code by clicking “File → Open” and then looking at the file You’ll notice that when they compute dZ it involves making a copy of dA. That is because of the way object references work in python. Here’s a thread which explains that.

Thank you, it fixed the problem. Actually I did come across that thread, while searching in the forum but it was for the same problem on that thread.