pytorch
c0ecd989 - Rename DispatchKey.PrivateUse1 to custom device in torchgen. (#99406)

Commit
1 year ago
Rename DispatchKey.PrivateUse1 to custom device in torchgen. (#99406) I want to use torchgen to generate code, and my yaml file format is the same as `native_functions.yaml`. I will use the PrivateUse1, but in my yaml file, I don't want to show PrivateUse1 to the user. So I want to achieve the following result(e.g. my device is `YPU`): ``` >>>from torchgen.model import DispatchKey >>>str(DispatchKey.PrivateUse1) "YPU" >>>DispatchKey.parse("YPU") DispatchKey.PrivateUse1 ``` I also thought that not everyone would need this feature, so I add a new func to handle this scenario. Pull Request resolved: https://github.com/pytorch/pytorch/pull/99406 Approved by: https://github.com/ezyang
Author
Committer
Parents
Loading