Usage of |
in type annotation causes torch.jit.script
to not work
#2583
Labels
help wanted
Extra attention is needed
Milestone
Describe the bug
torch.jit.script
on a model that callswarp_affine
withinforward
function fails with following error:Reproduction steps
Expected behavior
torch.jit.script
compiles.Environment
wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py # For security purposes, please check the contents of collect_env.py before running it. python collect_env.py
conda
,pip
, source): pipAdditional context
Optional[torch.device]
will work withtorch.jit.script
. I understand thattorch.device | None
is cleaner code, and more pythonic, but it would be great if this library supportedjit
The text was updated successfully, but these errors were encountered: