Rework compat bindings. (#47863)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47863
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D25199261
Pulled By: robieta
fbshipit-source-id: 0a4a0409ddb75c1bf66cd31d67b55080227b1679