-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Protect against dangerous default value. #268
Conversation
@@ -75,6 +77,7 @@ def __init__(self, | |||
middle_channels=32, | |||
num_stages=6, | |||
norm_cfg=dict(type='BN', requires_grad=True)): | |||
norm_cfg = copy.deepcopy(norm_cfg) |
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.
need to add that line of comment, so that future reader know what this line is for
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.
Apply to all?
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.
yea
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.
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.
Yes I see.
b0619e9
to
91fe125
Compare
Codecov Report
@@ Coverage Diff @@
## master #268 +/- ##
==========================================
+ Coverage 83.03% 83.74% +0.71%
==========================================
Files 112 113 +1
Lines 6448 6860 +412
Branches 1029 1083 +54
==========================================
+ Hits 5354 5745 +391
- Misses 901 918 +17
- Partials 193 197 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
mmpose/models/backbones/cpm.py
Outdated
@@ -75,6 +77,8 @@ def __init__(self, | |||
middle_channels=32, | |||
num_stages=6, | |||
norm_cfg=dict(type='BN', requires_grad=True)): | |||
# Protect against dangerous default value. |
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.
Use
Protect mutable default arguments
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.
The default values are not "dangerous" without knowing the context
b74f6e5
to
22ba40f
Compare
* Protect against dangerous default value. * Added comments.
* make 'FrameSelector' registered * update changelog * update changelog * Update changelog.md
* Protect against dangerous default value. * Added comments.
…b#268) * add base model, ddp model and unit test * add unit test * fix unit test * fix docstring * fix cpu unit test * refine base data preprocessor * refine base data preprocessor * refine interface of ddp module * remove optimizer hook * add forward * fix as comment * fix unit test * fix as comment * fix build optimizer wrapper * rebase main and fix unit test * stack_batch support stacking ndim tensor, add docstring for merge dict * fix lint * fix test loop * make precision_context effective to data_preprocessor * fix as comment * fix as comment * refine docstring * change collate_data output typehints * rename to_rgb to bgr_to_rgb and rgb_to_bgr * support build basemodel with built DataPreprocessor * fix as comment * fix docstring
* Protect against dangerous default value. * Added comments.
Fix #240