Skip to content

[DEBUG] test all float dtypes for images, videos, and boxes #7195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/prototype_common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def make_image_loaders(
"RGBA",
),
extra_dims=DEFAULT_EXTRA_DIMS,
dtypes=(torch.float32, 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):
Expand Down Expand Up @@ -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.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)
Expand Down Expand Up @@ -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.float64),
):
for params in combinations_grid(
size=sizes, color_space=color_spaces, num_frames=num_frames, extra_dims=extra_dims, dtype=dtypes
Expand Down
4 changes: 3 additions & 1 deletion test/prototype_transforms_kernel_infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sizes=["random"], dtypes=[torch.uint8, torch.float16, torch.float32, torch.float64]
sizes=["random"], dtypes=[torch.uint8, torch.float32, torch.float64]

Shouldn't we remove f16 from here as well ?

):
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)
Expand Down