[Bug] Avoid recursion error when using customized norm layer without _abbr_ (#732)

* avoid recursion error when using customized norm layer without _abbr_

* fix unittest bug
This commit is contained in:
Rui Xu 2020-12-22 10:19:52 +08:00 committed by GitHub
parent adc59b9f28
commit 826d3a7b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ def infer_abbr(class_type):
elif 'instance' in class_name:
return 'in'
else:
return 'norm'
return 'norm_layer'
def build_norm_layer(cfg, num_features, postfix=''):

View File

@ -101,7 +101,7 @@ def test_infer_norm_abbr():
class FancyNorm:
pass
assert infer_norm_abbr(FancyNorm) == 'norm'
assert infer_norm_abbr(FancyNorm) == 'norm_layer'
def test_build_norm_layer():