Fix autograd engine test in python_dispatch (#65567)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65567
Test Plan: Imported from OSS
Reviewed By: soulitzer
Differential Revision: D31158090
Pulled By: albanD
fbshipit-source-id: 651b78016ad978c7419343554ce7ceffd54aef1b