Week 1_A2_Exercise 4

Hi, could anyone tell me what this “np.int64(A2 > 0)” in the first line is doing?

(This is computing gradients in back propagation)


np.int64 converts all Boolean values (True/False) to integers of 1 or 0.

In my understanding, isn’t A2 already in terms of 0 and 1 from the forward propagation?


No, it is not.