[Autograd Testing] Few refactors to test_autograd.py (#35443)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35443
Addressing Wanchao's comments from
https://github.com/pytorch/pytorch/pull/35268.
ghstack-source-id: 100944390
Test Plan: waitforbuildbot
Differential Revision: D20662292
fbshipit-source-id: d98bf27106e858fe81e0f7755639c7da0f322913