def test_shape_evil(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], shape='churchill')
 def test_shape_row_column(self):
     for shape in ('row', 'column'):
         show_images([np.random.randn(28, 28)], shape=shape)
 def test_shape_dict(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28)], shape={})
 def test_bad_merge_shape(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], shape=(2, 1))
 def test_shape_negative(self):
     with pytest.raises(ValueError):
         show_images(np.random.randn(3, 28, 28), shape=(-4, 2))
 def test_pixel_range_integer(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28)], pixel_range=2)
 def test_pixel_range_string(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], pixel_range='min')
 def test_cannot_mix_inputs(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28), './images/'])
 def test_torch_tensor(self):
     show_images(torch.randn(4, 1, 28, 28))
Exemple #10
0
 def test_pass_numpy_array(self):
     show_images(np.random.randn(64, 28, 28))
     show_images(np.random.randn(64, 28, 28, 1))
     show_images(np.random.randn(16, 28, 28, 3))