Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36240 It's annoying, historical, and unnecessary (enum class is already namespaced). I did this codemod with: ``` git grep -l 'CPUTensorId' | xargs sed -i 's/CPUTensorId/CPU/g' git grep -l 'CUDATensorId' | xargs sed -i 's/CUDATensorId/CUDA/g' git grep -l 'VariableTensorId' | xargs sed -i 's/VariableTensorId/Autograd/g' git grep -l 'HIPTensorId' | xargs sed -i 's/HIPTensorId/HIP/g' git grep -l 'MSNPUTensorId' | xargs sed -i 's/MSNPUTensorId/MSNPU/g' git grep -l 'XLATensorId' | xargs sed -i 's/XLATensorId/XLA/g' git grep -l 'PrivateUse1_TensorId' | xargs sed -i 's/PrivateUse1_TensorId/PrivateUse1/g' git grep -l 'PrivateUse2_TensorId' | xargs sed -i 's/PrivateUse2_TensorId/PrivateUse2/g' git grep -l 'PrivateUse3_TensorId' | xargs sed -i 's/PrivateUse3_TensorId/PrivateUse3/g' git grep -l 'AutocastTensorId' | xargs sed -i 's/AutocastTensorId/Autocast/g' git grep -l '_PreAutogradTensorId' | xargs sed -i 's/_PreAutogradTensorId/_PreAutograd/g' git grep -l 'TESTING_ONLY_GenericWrapperTensorId' | xargs sed -i 's/TESTING_ONLY_GenericWrapperTensorId/TESTING_ONLY_GenericWrapper/g' git grep -l 'TESTING_ONLY_GenericModeTensorId' | xargs sed -i 's/TESTING_ONLY_GenericModeTensorId/TESTING_ONLY_GenericMode/g' ``` Then I did a git grep for remaining TensorId occurrences, and manually killed those (mostly in codegen, and some docs that needed updating). Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Differential Revision: D20929255 Pulled By: ezyang fbshipit-source-id: dc371b6aa6e6ea7c0a5660137c14debde806a09d |
||
|---|---|---|
| .. | ||
| DeviceGuardImplInterface.cpp | ||
| DeviceGuardImplInterface.h | ||
| FakeGuardImpl.h | ||
| InlineDeviceGuard.h | ||
| InlineEvent.h | ||
| InlineStreamGuard.h | ||
| LocalDispatchKeySet.cpp | ||
| LocalDispatchKeySet.h | ||
| README.md | ||
| VirtualGuardImpl.h | ||
c10/core/impl provides headers for functionality that is only needed in very specific use-cases (e.g., you are defining a new device type), which are generally only needed by C10 or PyTorch code. If you are an ordinary end-user, you should not use headers in this folder. We permanently give NO backwards-compatibility guarantees for implementations in this folder.
Compare with c10/util, which provides functionality that is not directly related to being a deep learning library (e.g., C++20 polyfills), but may still be generally useful and visible to users.
(We don't call this c10/detail, because the detail namespace convention is for header private details. However, c10::impl may be utilized from external headers; it simply indicates that the functionality is not for end users.)