def test_draw_point2d_with_mismatched_dtype(self, device):
        """Test that the color is correctly cast to the image dtype when drawing points."""
        points = torch.tensor([(1, 3), (2, 4)], device=device)
        color = torch.tensor([5, 10, 15], dtype=torch.float32, device=device)
        img = torch.zeros(3, 8, 8, dtype=torch.uint8, device=device)
        img = draw_point2d(img, points, color)
        assert img.dtype is torch.uint8
        for x, y in points:
            assert_close(img[:, y, x], color.to(torch.uint8))
Test that the color is correctly cast to the image dtype when drawing points.
tests/utils/test_draw.py