Add at::dimname_to_position helper. (#21789)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21789
ghimport-source-id: 42c0a58280f3645dd38ea11d39311a0c53f90488
Test Plan:
- `build/bin/NamedTensor_test` [namedtensor ci]
Imported from OSS
Differential Revision: D15833455
Pulled By: zou3519
fbshipit-source-id: 8dd51a7b785972668984a7c161b94b92039a1cb1