Delete a few cases where we directly use Backend/TensorTypeId. (#25467)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25467
Use Layout/Device more directly in these cases.
ghstack-source-id: 89289651
Test Plan: sandcastle and ossci
Differential Revision: D17131883
fbshipit-source-id: ab3c6d1c879b7f26f20a2378364c852dc37508fc