Fix incorrect merge of #34136. (#36760)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36760
If you look at https://github.com/pytorch/pytorch/pull/34136/, you will notice a commit (https://github.com/pytorch/pytorch/pull/34136/commits/80c15c087ca652c535f5883cfb2564c8930aa593) that didn't get merged.
This is to address that, to avoid crashing on remainder when the rhs is 0.
Test Plan: Imported from OSS
Differential Revision: D21078776
Pulled By: gchanan
fbshipit-source-id: 0ac138cbafac28cf8d696a2a413d3c542138cff9