From 7213e5669bbdbf2f2712fecbc68354b5d09a97ac Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 8 Feb 2023 20:21:19 +0100 Subject: [PATCH 1/2] [DEBUG] test all float dtypes for images, videos, and boxes --- test/prototype_common_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/prototype_common_utils.py b/test/prototype_common_utils.py index 1cea10603ec..a38fa61cc66 100644 --- a/test/prototype_common_utils.py +++ b/test/prototype_common_utils.py @@ -295,7 +295,7 @@ def make_image_loaders( "RGBA", ), extra_dims=DEFAULT_EXTRA_DIMS, - dtypes=(torch.float32, torch.uint8), + dtypes=(torch.float32, torch.float16, torch.float64, torch.uint8), constant_alpha=True, ): for params in combinations_grid(size=sizes, color_space=color_spaces, extra_dims=extra_dims, dtype=dtypes): @@ -417,7 +417,7 @@ def make_bounding_box_loaders( extra_dims=DEFAULT_EXTRA_DIMS, formats=tuple(datapoints.BoundingBoxFormat), spatial_size="random", - dtypes=(torch.float32, torch.int64), + dtypes=(torch.float32, torch.float16, torch.float64, torch.int64), ): for params in combinations_grid(extra_dims=extra_dims, format=formats, dtype=dtypes): yield make_bounding_box_loader(**params, spatial_size=spatial_size) @@ -609,7 +609,7 @@ def make_video_loaders( ), num_frames=(1, 0, "random"), extra_dims=DEFAULT_EXTRA_DIMS, - dtypes=(torch.uint8,), + dtypes=(torch.uint8, torch.float32, torch.float16, torch.float64), ): for params in combinations_grid( size=sizes, color_space=color_spaces, num_frames=num_frames, extra_dims=extra_dims, dtype=dtypes From 4e843d9c5dc56ab0ab46366a03e7dfdc55591e96 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Feb 2023 09:39:34 +0100 Subject: [PATCH 2/2] remove float16 for now --- test/prototype_common_utils.py | 6 +++--- test/prototype_transforms_kernel_infos.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/prototype_common_utils.py b/test/prototype_common_utils.py index a38fa61cc66..c7bf18e22a7 100644 --- a/test/prototype_common_utils.py +++ b/test/prototype_common_utils.py @@ -295,7 +295,7 @@ def make_image_loaders( "RGBA", ), extra_dims=DEFAULT_EXTRA_DIMS, - dtypes=(torch.float32, torch.float16, torch.float64, torch.uint8), + dtypes=(torch.float32, torch.float64, torch.uint8), constant_alpha=True, ): for params in combinations_grid(size=sizes, color_space=color_spaces, extra_dims=extra_dims, dtype=dtypes): @@ -417,7 +417,7 @@ def make_bounding_box_loaders( extra_dims=DEFAULT_EXTRA_DIMS, formats=tuple(datapoints.BoundingBoxFormat), spatial_size="random", - dtypes=(torch.float32, torch.float16, torch.float64, torch.int64), + dtypes=(torch.float32, torch.float64, torch.int64), ): for params in combinations_grid(extra_dims=extra_dims, format=formats, dtype=dtypes): yield make_bounding_box_loader(**params, spatial_size=spatial_size) @@ -609,7 +609,7 @@ def make_video_loaders( ), num_frames=(1, 0, "random"), extra_dims=DEFAULT_EXTRA_DIMS, - dtypes=(torch.uint8, torch.float32, torch.float16, torch.float64), + dtypes=(torch.uint8, torch.float32, torch.float64), ): for params in combinations_grid( size=sizes, color_space=color_spaces, num_frames=num_frames, extra_dims=extra_dims, dtype=dtypes diff --git a/test/prototype_transforms_kernel_infos.py b/test/prototype_transforms_kernel_infos.py index 1fac1526248..2c07224d384 100644 --- a/test/prototype_transforms_kernel_infos.py +++ b/test/prototype_transforms_kernel_infos.py @@ -1263,7 +1263,9 @@ def _get_elastic_displacement(spatial_size): def sample_inputs_elastic_image_tensor(): - for image_loader in make_image_loaders(sizes=["random"]): + for image_loader in make_image_loaders( + sizes=["random"], dtypes=[torch.uint8, torch.float16, torch.float32, torch.float64] + ): displacement = _get_elastic_displacement(image_loader.spatial_size) for fill in get_fills(num_channels=image_loader.num_channels, dtype=image_loader.dtype): yield ArgsKwargs(image_loader, displacement=displacement, fill=fill)