-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Added annotation typing to shufflenet #2864
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick plus incremental changes from the other PRs. Otherwise LGTM.
Still getting a troublesome error with mypy though:
Any ideas? I tried a few things in vain unfortunately |
I'll let @pmeier have a look, I don't know why mypy is thinking that |
Me neither. I think that might be caused by the way
We could simply include |
I'm not exactly sure how to do it, given that we use self.stage2 = create(...) ? That is a big big change for just typing, can't we disable mypy somehow? |
Sure we can. We could also x = cast(nn.Sequential, self.stage2)(x) or put a block of static annotations above the creation loop self.stage1: nn.Sequential
self.stage2: nn.Sequential |
Hi @frgfm! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
self.stage2: nn.Sequential | ||
self.stage3: nn.Sequential | ||
self.stage4: nn.Sequential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: it would have been preferable to let stage{}
be a nn.Module
, as they could potentially be any type of nn.Module
, not just Sequential
* style: Added annotation typing for shufflenet * fix: Removed duplicate type hint * refactor: Removed un-necessary import * fix: Fixed constructor typing * style: Added black formatting on depthwise_conv * style: Fixed stage typing in shufflenet
* style: Added annotation typing for shufflenet * fix: Removed duplicate type hint * refactor: Removed un-necessary import * fix: Fixed constructor typing * style: Added black formatting on depthwise_conv * style: Fixed stage typing in shufflenet
Hi there!
As per #2025, annotation typing are welcome in torchvision. So, this PR focuses on
torchvision.models.shufflenet
this PR!Any feedback is welcome!