Consolidate nondeterministic error tests (#55631)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/51498
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55631
Reviewed By: malfet
Differential Revision: D27909953
Pulled By: mruberry
fbshipit-source-id: 9115b2433f9c276555be55bd51b270a7a2846829