示例#1
0
 def test_shape_evil(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], shape='churchill')
示例#2
0
 def test_shape_row_column(self):
     for shape in ('row', 'column'):
         show_images([np.random.randn(28, 28)], shape=shape)
示例#3
0
 def test_shape_dict(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28)], shape={})
示例#4
0
 def test_bad_merge_shape(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], shape=(2, 1))
示例#5
0
 def test_shape_negative(self):
     with pytest.raises(ValueError):
         show_images(np.random.randn(3, 28, 28), shape=(-4, 2))
示例#6
0
 def test_pixel_range_integer(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28)], pixel_range=2)
示例#7
0
 def test_pixel_range_string(self):
     with pytest.raises(ValueError):
         show_images([np.random.randn(28, 28)], pixel_range='min')
示例#8
0
 def test_cannot_mix_inputs(self):
     with pytest.raises(TypeError):
         show_images([np.random.randn(28, 28), './images/'])
示例#9
0
 def test_torch_tensor(self):
     show_images(torch.randn(4, 1, 28, 28))
示例#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))