Unverified Commit db530d8c authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

More robust assertion checks in test_to_tensor_video (#4258)

parent d7fa36f2
...@@ -133,12 +133,16 @@ class TestVideoTransforms(): ...@@ -133,12 +133,16 @@ class TestVideoTransforms():
with pytest.raises(TypeError): with pytest.raises(TypeError):
np_rng = np.random.RandomState(0) np_rng = np.random.RandomState(0)
trans(np_rng.rand(numFrames, height, width, 1).tolist()) trans(np_rng.rand(numFrames, height, width, 1).tolist())
with pytest.raises(TypeError):
trans(torch.rand((numFrames, height, width, 1), dtype=torch.float)) trans(torch.rand((numFrames, height, width, 1), dtype=torch.float))
with pytest.raises(ValueError): with pytest.raises(ValueError):
trans(torch.ones((3, numFrames, height, width, 3), dtype=torch.uint8)) trans(torch.ones((3, numFrames, height, width, 3), dtype=torch.uint8))
with pytest.raises(ValueError):
trans(torch.ones((height, width, 3), dtype=torch.uint8)) trans(torch.ones((height, width, 3), dtype=torch.uint8))
with pytest.raises(ValueError):
trans(torch.ones((width, 3), dtype=torch.uint8)) trans(torch.ones((width, 3), dtype=torch.uint8))
with pytest.raises(ValueError):
trans(torch.ones((3), dtype=torch.uint8)) trans(torch.ones((3), dtype=torch.uint8))
trans.__repr__() trans.__repr__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment