Clean up some legacy scalar/empty handling. (#34217)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34217
LegacyNoScalar variants cause 0-dim tensors to behave like 1-dim tensors.
LegacyAll variants cause 0-dim tensors to behave like 1-dim tensors, and numel == 0 tensors to be treated like 0-dimensional tensors.
This this was done by codemod, these are often unneeded and often translated incorrectly to ATen.
Test Plan: Imported from OSS
Differential Revision: D20249577
Pulled By: gchanan
fbshipit-source-id: 6f2876d3e479562c9323f3629357a73a47869150