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

fix weight_init.py #825

Merged
merged 2 commits into from
Feb 7, 2021
Merged

fix weight_init.py #825

merged 2 commits into from
Feb 7, 2021

Conversation

MeowZheng
Copy link
Collaborator

use kwargs instead of the same arguments in BaseInit, and fix docstring and error msg.

@codecov
Copy link

codecov bot commented Feb 7, 2021

Codecov Report

Merging #825 (3077fe5) into master (4712db7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #825   +/-   ##
=======================================
  Coverage   62.92%   62.92%           
=======================================
  Files         145      145           
  Lines        8674     8674           
  Branches     1569     1569           
=======================================
  Hits         5458     5458           
  Misses       2951     2951           
  Partials      265      265           
Flag Coverage Δ
unittests 62.92% <100.00%> (ø)

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

Impacted Files Coverage Δ
mmcv/cnn/utils/weight_init.py 98.80% <100.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 4712db7...3077fe5. Read the comment docs.

@@ -77,7 +77,7 @@ def bias_init_with_prob(prior_prob):

class BaseInit(object):

def __init__(self, bias, bias_prob, layer):
def __init__(self, bias=0, bias_prob=None, layer=None):
Copy link
Member

Choose a reason for hiding this comment

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

We can force keyword arguments by

def __init__(self, *, bias=0, bias_prob=None, layer=None):

@hellock hellock merged commit 999f2d0 into open-mmlab:master Feb 7, 2021
@MeowZheng MeowZheng deleted the amend_init branch February 19, 2021 04:54
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.

2 participants