We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ToImage()
1 parent dd1706a commit 7b283c2Copy full SHA for 7b283c2
torchvision/tv_tensors/_image.py
@@ -43,7 +43,7 @@ def __new__(
43
44
tensor = cls._to_tensor(data, dtype=dtype, device=device, requires_grad=requires_grad)
45
if tensor.ndim < 2:
46
- raise ValueError
+ raise ValueError(f"Tensor must be 2D or higher, got {tensor.ndim}D tensor.")
47
elif tensor.ndim == 2:
48
tensor = tensor.unsqueeze(0)
49
0 commit comments