Say a and b are two tensors with gradient. Is there a difference between the following two methods in defining a new tensor from multiplication if I don’t need a gradient for c? Does the second method save
- c = torch.mul(a, b).detach()
- c = torch.zeros_like(a, requires_grad=False)
c = torch.addcmul(c, a, b)