Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
add test_scale for test_feature_predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
okdshin committed Dec 6, 2019
1 parent f276a59 commit e3df429
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/links_tests/model_tests/test_feature_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def test_gpu(self):
'crop_size': [192, (192, 256), (256, 192)],
'scale_size': [None, 256, (256, 256)],
'in_channels': [1, 3],
'mean': [None, np.float32(1)]
'mean': [None, np.float32(1)],
'scale': [None, np.float32(1)]
}))
class TestFeaturePredictor(unittest.TestCase):

Expand All @@ -88,7 +89,7 @@ def setUp(self):
self.link = FeaturePredictor(
DummyFeatureExtractor(self.in_channels, (1,), None),
crop_size=self.crop_size, scale_size=self.scale_size,
crop=self.crop, mean=self.mean)
crop=self.crop, mean=self.mean, scale=self.scale)

if isinstance(self.crop_size, int):
hw = (self.crop_size, self.crop_size)
Expand Down Expand Up @@ -117,5 +118,12 @@ def test_mean(self):
else:
np.testing.assert_equal(self.link.mean, self.mean)

def test_scale(self):
if self.scale is None:
np.testing.assert_equal(self.link.scale, None)
else:
np.testing.assert_equal(self.link.scale, self.scale)



testing.run_module(__name__, __file__)

0 comments on commit e3df429

Please sign in to comment.