Unverified Commit da61ff8c authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Replace with explicit check on image. (#3239)


Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
parent ae0d80b3
...@@ -59,8 +59,7 @@ def convert_image_dtype(image: torch.Tensor, dtype: torch.dtype = torch.float) - ...@@ -59,8 +59,7 @@ def convert_image_dtype(image: torch.Tensor, dtype: torch.dtype = torch.float) -
if image.dtype == dtype: if image.dtype == dtype:
return image return image
# TODO: replace with image.dtype.is_floating_point when torchscript supports it if image.is_floating_point():
if torch.empty(0, dtype=image.dtype).is_floating_point():
# TODO: replace with dtype.is_floating_point when torchscript supports it # TODO: replace with dtype.is_floating_point when torchscript supports it
if torch.tensor(0, dtype=dtype).is_floating_point(): if torch.tensor(0, dtype=dtype).is_floating_point():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment