def test_invalid_scale_factor(self): from lasagne.layers.pool import Upscale1DLayer inlayer = self.input_layer((128, 3, 32)) with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=0) with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=-1) with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=(0))
def test_invalid_mode(self): from lasagne.layers.pool import Upscale1DLayer inlayer = self.input_layer((128, 3, 32)) with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=1, mode='') with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=1, mode='other') with pytest.raises(ValueError): Upscale1DLayer(inlayer, scale_factor=1, mode=0)
def layer(self, input_layer, scale_factor, mode): from lasagne.layers.pool import Upscale1DLayer return Upscale1DLayer( input_layer, scale_factor=scale_factor, mode=mode, )