Ensure linearIndex of advanced indexing backwards is contiguous. (#36959)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36959
This is a more straightforward solution to the problem than https://github.com/pytorch/pytorch/pull/36957; I don't know about the relative performance.
Fixes: #36956
Test Plan: Imported from OSS
Differential Revision: D21144146
Pulled By: gchanan
fbshipit-source-id: a10ab905219a73157d5d7183492b52d7c8dd6072