- Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Description
🐛 Describe the bug
Please see this line on the main branch.
| return "AVX2" in torch.backends.cpu.get_cpu_capability() |
It decides whether the image resize can be done for uint8 datatype with native CPU.
However, the return type of torch.backends.cpu.get_cpu_capability() is not a kind of set or sequence of strs. It returns str, https://pytorch.org/docs/2.2/backends.html#torch.backends.cpu.get_cpu_capability. Therefore, on a AVX512 support machine, torch.backends.cpu.get_cpu_capability() returns "AVX512" and it leads to float32 casting at
vision/torchvision/transforms/v2/functional/_geometry.py
Lines 256 to 258 in 5181a85
| need_cast = dtype not in acceptable_dtypes | |
| if need_cast: | |
| image = image.to(dtype=torch.float32) |
although this machine can support AVX2.
Versions
torch>=2.1 and torchvision>=0.16.1
RobinKa
Metadata
Metadata
Assignees
Labels
No labels