-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Issue 7] Update import torchvision.models as models #26
Conversation
@kit1980 I am aware that we could refactor the new class I added and _UpdateFunctorchImports into a generalized class for import replacement. Shall I do it here, or leave it for a future commit? |
tests/fixtures/deprecated_symbols/codemod/torchvision_models.py
Outdated
Show resolved
Hide resolved
@gesuwen Thank you for the PR. I've left some comments and I think in general this should be a separate rule with a separate code, like TOR201, to report the issue. |
@kit1980 Thanks for your review! I just updated the PR, resolving all suggestions. Commit 2 move the new visitor to the vision dir and include giving LintViolation warning + replacement option. Could you please help review again and let me know if there is any addition suggestion? |
610cba9
to
b5fa0ea
Compare
b5fa0ea
to
d117792
Compare
@gesuwen Looks good to me, thanks! I'll do the codemod part later after factoring some things around import replacements. |
Create a new _UpdateTorchvisionModelsImports class to replace all "import torchvision.models as models" to "from torchvision import models"