I guess args is tensor of the model output right?
As @albanD mentioned, if you convert args(tensor) into s(numpy ) then use s as loss, there occurs no gradient computation.
torch.Tensor supports numpy like operations. I suppose you would rather use tensor operations described here 17