Skip to content

Commit 24729b6

Browse files
committed
guard
Signed-off-by: Masaki Kozuki <[email protected]>
1 parent 8da296b commit 24729b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

thunder/dynamo/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ def _get_min_and_val(t: torch.Tensor) -> tuple[Number | None, Number | None]:
533533
or t.device.type == "meta"
534534
or t.numel() == 0
535535
or t.dtype.is_complex
536-
or t.dtype == torch.float4_e2m1fn_x2
536+
or (
537+
not hasattr(torch, "float4_e2m1fn_x2")
538+
or (hasattr(torch, "float4_e2m1fn_x2") and t.dtype == torch.float4_e2m1fn_x2)
539+
)
537540
):
538541
return None, None
539542
if t.dtype in (torch.float8_e4m3fn, torch.float8_e4m3fnuz, torch.float8_e5m2, torch.float8_e5m2fnuz):

0 commit comments

Comments
 (0)