Change order of recalculating numel and restriding (#30025)
Summary:
Fix order of recalculating numel and restriding as first one should always go first
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30025
Differential Revision: D18576446
Pulled By: VitalyFedyunin
fbshipit-source-id: fe9e18ec2bbb7b43d634e150f8979b8d6b7c5196