Пример #1
0
 def test_multi_keys(self, resnet18):
     param = list(helper.match_parameters(resnet18,
                                          ['conv1', 'downsample']))
     assert len(param) == 18
Пример #2
0
    def test_regex(self, resnet18):
        param = helper.match_parameters(resnet18, ['downsample.*.weight$'])
        assert len(list(param)) == 6

        param = helper.match_parameters(resnet18, ['downsample.*.wei$'])
        assert not list(param)
Пример #3
0
 def test_single_key(self, resnet18):
     param = helper.match_parameters(resnet18, ['downsample.0.weight'])
     assert len(list(param)) == 3