Hi,
The first one will prevent gradients flowing back towards I_w. So for the gradient computation, it will be as if this Tensor contained constant values that are independent of the weights.

and Which one should be used?

It depends on what you’re trying to do