diff --git a/test/test_transforms_video.py b/test/test_transforms_video.py index 5ae9192c4b6..975b425f6a5 100644 --- a/test/test_transforms_video.py +++ b/test/test_transforms_video.py @@ -133,12 +133,16 @@ def test_to_tensor_video(self): with pytest.raises(TypeError): np_rng = np.random.RandomState(0) trans(np_rng.rand(numFrames, height, width, 1).tolist()) + with pytest.raises(TypeError): trans(torch.rand((numFrames, height, width, 1), dtype=torch.float)) with pytest.raises(ValueError): trans(torch.ones((3, numFrames, height, width, 3), dtype=torch.uint8)) + with pytest.raises(ValueError): trans(torch.ones((height, width, 3), dtype=torch.uint8)) + with pytest.raises(ValueError): trans(torch.ones((width, 3), dtype=torch.uint8)) + with pytest.raises(ValueError): trans(torch.ones((3), dtype=torch.uint8)) trans.__repr__()