Fix the arithmetic overflow issue for MSVC (#27596)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/27568.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27596
Differential Revision: D17831612
Pulled By: ezyang
fbshipit-source-id: eff18095a74b6b82f70ed3f11d201483097205c5