fix test_dispatch tests to error on duplicate def (#49254)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49254
Test Plan: Imported from OSS
Reviewed By: ezyang
Differential Revision: D25505170
Pulled By: bdhirsh
fbshipit-source-id: 6796f4ce022c3141934ee69c7caaa08e663adf39