def test_bias(self): unet = Unet( in_features=3, down=[16, 32, 64], up=[40, 4], ) checker = lambda name_weight: 'bias' in name_weight[0] bias = any(map(checker, unet.named_parameters())) self.assertTrue(bias)
def test_no_bias(self): unet = Unet(in_features=3, down=[16, 32, 64], up=[40, 4], setup={ **fat_setup, 'bias': False }) checker = lambda name_weight: 'bias' not in name_weight[0] no_bias = all(map(checker, unet.named_parameters())) self.assertTrue(no_bias)