Add division logic to a slow/fast path (#49250)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49250
Test Plan: Imported from OSS
Reviewed By: zou3519
Differential Revision: D25502938
Pulled By: izdeby
fbshipit-source-id: bdd583464eb15d7cb30fd0c22d119cc4b31cbf8d