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

Protect against dangerous default value. #268

Merged
merged 2 commits into from
Nov 12, 2020
Merged

Protect against dangerous default value. #268

merged 2 commits into from
Nov 12, 2020

Conversation

yaochaorui
Copy link
Contributor

@yaochaorui yaochaorui commented Nov 10, 2020

Fix #240

@@ -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)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apply to all?

Copy link
Contributor

Choose a reason for hiding this comment

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

yea

Copy link
Contributor

Choose a reason for hiding this comment

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

like this

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I see.

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #268 (2ec21bd) into master (28256fe) will increase coverage by 0.71%.
The diff coverage is 89.68%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 83.74% <89.68%> (+0.74%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/apis/test.py 27.58% <0.00%> (-0.33%) ⬇️
mmpose/core/evaluation/eval_hooks.py 66.66% <0.00%> (ø)
...asets/datasets/bottom_up/bottom_up_base_dataset.py 82.50% <0.00%> (ø)
mmpose/datasets/datasets/mesh/mesh_mix_dataset.py 91.30% <0.00%> (-4.16%) ⬇️
mmpose/models/backbones/base_backbone.py 100.00% <ø> (+6.66%) ⬆️
mmpose/models/detectors/base.py 60.41% <ø> (+4.64%) ⬆️
mmpose/models/losses/mesh_loss.py 97.67% <66.66%> (+0.01%) ⬆️
...models/keypoint_heads/top_down_multi_stage_head.py 85.06% <69.33%> (-14.94%) ⬇️
mmpose/apis/inference.py 65.83% <75.00%> (ø)
mmpose/datasets/pipelines/bottom_up_transform.py 90.04% <80.00%> (+0.08%) ⬆️
... and 39 more

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 28256fe...22ba40f. Read the comment docs.

@@ -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.
Copy link
Contributor

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

Copy link
Contributor

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

@innerlee innerlee merged commit cc826e0 into master Nov 12, 2020
@innerlee innerlee deleted the ycr/W0102 branch November 12, 2020 12:31
wusize pushed a commit that referenced this pull request Nov 13, 2020
* Protect against dangerous default value.

* Added comments.
rollingman1 pushed a commit to rollingman1/mmpose that referenced this pull request Nov 5, 2021
* make 'FrameSelector' registered

* update changelog

* update changelog

* Update changelog.md
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
* Protect against dangerous default value.

* Added comments.
HAOCHENYE added a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
…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
ajgrafton pushed a commit to ajgrafton/mmpose that referenced this pull request Mar 6, 2024
* Protect against dangerous default value.

* Added comments.
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.

Pylint: W0102
2 participants