Refactored assertAutodiff test to have better error message (#48567)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/48567
Test Plan: Imported from OSS
Reviewed By: eellison
Differential Revision: D25212435
Pulled By: Lilyjjo
fbshipit-source-id: eab3933bf4248dbfa20cd956d4a0106b10db5fc4