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