Check commutativity for computed dispatch table and add a test to check entries. (#44088)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/44088
Test Plan: Imported from OSS
Reviewed By: ezyang
Differential Revision: D23492793
Pulled By: ailzhang
fbshipit-source-id: 37502f2a8a4d755219b400fcbb029e49d6cdb6e9