Date: 05.01.2026
PyTorch dtype compatibility — quick cheat sheet
The table below shows, dtype in API that we can use in torch_dtype=... for PyTorch versions
Floating-point dtype
| PyTorch version | Supported dtype |
|---|---|
| ≥ 1.1 | torch.float16 (torch.half)torch.float32 (torch.float)torch.float64 (torch.double) |
| ≥ 1.6 | torch.float16 (torch.half)torch.float32 (torch.float)torch.float64 (torch.double)torch.bfloat16 |
| ≥ 2.2 | torch.float16 (torch.half)torch.float32 (torch.float)torch.float64 (torch.double)torch.bfloat16torch.float8_e4m3fntorch.float8_e5m2 |
| ≥ 2.9 | torch.float16 (torch.half)torch.float32 (torch.float)torch.float64 (torch.double)torch.bfloat16torch.float8_e4m3fntorch.float8_e5m2torch.float8_e4m3fnuztorch.float8_e5m2fnuztorch.float8_e8m0fnutorch.float4_e2m1fn_x2 |