fix arange shape issue inconsistency across cpu and cuda (#18462)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/18363
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18462
Differential Revision: D14620263
Pulled By: soumith
fbshipit-source-id: 223524cdda2f5d55c2ca8d4cdcf6f7a05a6c15eb