There’s probably a way in which to do this without the use of the torch.autograd.functional library, although I’m not 100% how to do this. You could have a look at the source code for both functions and see if you can reproduce them without upgrading pytorch?
If you can update pytorch I’d recommend you do it.