- Validate images and masks are torch.Tensor objects
- Validate images is 4D (B, H, W, C) and masks is 3D (B, H, W)
- Validate images and masks have matching batch sizes
- Validate images and masks have matching spatial dimensions
- Add comprehensive tests for all validation error cases
Previously, shape mismatches caused cryptic IndexError messages.
Now users get clear, actionable error messages.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>