Fix overflow check in `geometry_is_contiguous` (#73162)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73162
The existing check isn't safe for 32-bit `size_t` because the max
64-bit int will overflow.
Test Plan: Imported from OSS
Reviewed By: albanD
Differential Revision: D34524229
Pulled By: malfet
fbshipit-source-id: 58b1bb2fa605e9972644723ba8b37643ba024f38
(cherry picked from commit b15aa0fbd49153bcdf61bc7676449f3ee4a5bb51)