-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Syntax error in type annotations #2061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You never merged the PR although @eellison approved it. Does that mean the way you did it does not work with TorchScript? If adding the return type as you did does indeed work with TorchScript could you rebase and merge your PR. I would take up the rest. |
That PR had failing tests, and I never had the chance to get back to it and fix it so that it is compatible with mypy and torchscript. @zhangguanheng66 are you still looking at fixing type annotations in #1696? |
In the light of first inline type annotations, a static type check via
mypy
was requested in #2034 (review).Running
mypy
on the currenttorchvision
results in syntax errors in several type annotations. For example:Since syntax errors are fatal they cannot be silenced even with
ignore_errors
set. Furthermore,mypy
stops the checking after it encountered a module with syntax errors.Thus, if we want to include
mypy
checks in CI and test if they work we need to either fix them or disable them temporarily and fix them later. Since they seem to be related totorch.jit
, I have no idea how much work fixing them would be or how much damage temporarily disabling them will do.The text was updated successfully, but these errors were encountered: