The error message should also mention, that you can use retain_grad() on the non-leaf variable to get the gradient.
ev1 = resnet(tensor1)
evt.retain_grad()
...

should therefore work.
Unrelated to this issue, but you should use .requires_grad (with an s) and you should not use the .data attribute as it might yield unwanted side effects.