Removed python dispatch keys from dispatch key extraction

Fixes this issue

https://github.com/facebookresearch/torchdynamo/issues/81
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74971
Approved by: https://github.com/zou3519
This commit is contained in:
Horace He 2022-03-31 01:32:34 +00:00 committed by PyTorch MergeBot
parent 5547741960
commit 3c1dd4e752

View file

@ -329,7 +329,8 @@ static inline DispatchKey legacyExtractDispatchKey(DispatchKeySet s) {
// here. At the moment, autograd keys and ADInplaceOrView key need this
// treatment;
return (s - autograd_dispatch_keyset_with_ADInplaceOrView -
autocast_dispatch_keyset)
autocast_dispatch_keyset -
DispatchKeySet({DispatchKey::PythonTLSSnapshot, DispatchKey::Python}))
.highestPriorityTypeId();
}