Don’t use Tensor(...) or .data any more! They have been deprecated since PyTorch 0.4.
the reason you are not getting an error for the first is that the + backward doesn’t need any saved tensors while the multiplication needs the other argument to compute the input gradient from the output gradient. These are the ones getting freed in the backpropagation and so you get the error.
Best regards
Thomas