Please don’t tag specific users, as it could discourage others to post an answer.
The error is raised as you are using a deprecated utility and should use custom autograd.Functions as described here 2.