Check support_as_strided before using empty_strided. (#46746)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/46746
Test Plan: Imported from OSS
Reviewed By: bhosmer
Differential Revision: D24492468
Pulled By: ailzhang
fbshipit-source-id: 25f869e64cf8628e41661edca9823e95170ae1ed