Skip to content
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

Added number of features in FrozenBatchNorm2d __repr__ #2168

Merged
merged 8 commits into from May 5, 2020

Conversation

frgfm
Copy link
Contributor

@frgfm frgfm commented Apr 30, 2020

This PR aims at:

  • adding information in the __repr__ attribute to the FrozenBatchNorm2d class
  • adding a corresponding unittest

Suggestions are welcomed for the proposed formatting!

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 for the PR!

I have a comment, let me know what you think

torchvision/ops/misc.py Outdated Show resolved Hide resolved
Since support of Python version ealier than 3.6 have been dropped, f-string can be used.
@codecov-io
Copy link

codecov-io commented May 1, 2020

Codecov Report

Merging #2168 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2168      +/-   ##
=========================================
- Coverage    0.48%   0.48%   -0.01%     
=========================================
  Files          92      92              
  Lines        7442    7444       +2     
  Branches     1135    1135              
=========================================
  Hits           36      36              
- Misses       7393    7395       +2     
  Partials       13      13              
Impacted Files Coverage Δ
torchvision/ops/misc.py 0.00% <0.00%> (ø)

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 f9ef235...3645ac4. Read the comment docs.

@frgfm frgfm requested a review from fmassa May 2, 2020 08:48
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.

LGTM, thanks a lot @frgfm !

I would just want to ping @seemethere , because with this PR we effectively break support for Python 3.5 due to the f-strings, so I wanted to get his approval first.

test/test_ops.py Outdated Show resolved Hide resolved
@frgfm frgfm requested a review from seemethere May 4, 2020 23:13
@fmassa fmassa merged commit 5db8998 into pytorch:master May 5, 2020
@frgfm frgfm deleted the frozenbn-repr branch May 5, 2020 14:40
fmassa pushed a commit to fmassa/vision-1 that referenced this pull request Jul 8, 2020
* feat: Added number of features in FrozenBatchNorm2d repr

While BatchNorm layers have extensive information in their repr, FrozenBatchNorm2d has one

* refactor: Refactored FrozenBatchNorm2d __repr__

* test: Added unittest for FrozenBatchNorm2d __repr__

* style: Removed blank lines in test_ops

* refactor: Avoids creating an extra attribute for __repr__

* style: Switched __repr__ to f-string

Since support of Python version ealier than 3.6 have been dropped, f-string can be used.

* fix: Fixed typo in __repr__

* style: Switched unittest .format to f-string
facebook-github-bot pushed a commit that referenced this pull request Jul 9, 2020
Summary:
* feat: Added number of features in FrozenBatchNorm2d repr

While BatchNorm layers have extensive information in their repr, FrozenBatchNorm2d has one

* refactor: Refactored FrozenBatchNorm2d __repr__

* test: Added unittest for FrozenBatchNorm2d __repr__

* style: Removed blank lines in test_ops

* refactor: Avoids creating an extra attribute for __repr__

* style: Switched __repr__ to f-string

Since support of Python version ealier than 3.6 have been dropped, f-string can be used.

* fix: Fixed typo in __repr__

* style: Switched unittest .format to f-string

Pull Request resolved: #2431

Reviewed By: zhangguanheng66

Differential Revision: D22437793

Pulled By: fmassa

fbshipit-source-id: 76fd6a42f0b6cabe47c96fcb5a343fe580a0005e
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.

None yet

4 participants