Skip to content

Added annotation typing to mnasnet #2856

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

Merged
merged 2 commits into from
Oct 22, 2020
Merged

Conversation

frgfm
Copy link
Contributor

@frgfm frgfm commented Oct 21, 2020

Hi there!

As per #2025, annotation typing are welcome in torchvision. So, this PR focuses on torchvision.models.mnasnet this PR !

Any feedback is welcome!

@pmeier pmeier self-assigned this Oct 21, 2020
@codecov
Copy link

codecov bot commented Oct 21, 2020

Codecov Report

Merging #2856 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2856   +/-   ##
=======================================
  Coverage   73.36%   73.37%           
=======================================
  Files          99       99           
  Lines        8787     8790    +3     
  Branches     1387     1387           
=======================================
+ Hits         6447     6450    +3     
  Misses       1916     1916           
  Partials      424      424           
Impacted Files Coverage Δ
torchvision/models/mnasnet.py 76.00% <100.00%> (+0.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57b653c...92a8296. Read the comment docs.

import torch.nn as nn
from .utils import load_state_dict_from_url
from torch.jit.annotations import Dict, List
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we now use Python3, you can now import Dict and List from typing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is not very important as a change, but it is a nice cleanup that could be done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought it was for jittability reasons on those specific types. I'll update the other PRs too then!

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fmassa fmassa merged commit 67e7879 into pytorch:master Oct 22, 2020
@frgfm frgfm deleted the mnasnet-typing branch October 22, 2020 14:21
bryant1410 pushed a commit to bryant1410/vision-1 that referenced this pull request Nov 22, 2020
* style: Added annotation typing for mnasnet

* refactor: Removed un-necessary import
vfdev-5 pushed a commit to Quansight/vision that referenced this pull request Dec 4, 2020
* style: Added annotation typing for mnasnet

* refactor: Removed un-necessary import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants