From 324e728bbae0e73841df2b2a1750c074c53af139 Mon Sep 17 00:00:00 2001 From: KerfuffleV2 Date: Thu, 4 Jan 2024 00:30:31 -0700 Subject: [PATCH] fix: missing parenthesis in ipex autocast --- modules/intel/ipex/hijacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/intel/ipex/hijacks.py b/modules/intel/ipex/hijacks.py index 4a44920e2..0dbec3739 100644 --- a/modules/intel/ipex/hijacks.py +++ b/modules/intel/ipex/hijacks.py @@ -28,7 +28,7 @@ def return_xpu(device): # Autocast original_autocast = torch.autocast def ipex_autocast(*args, **kwargs): - if len(args) > 0 and args[0] == "cuda" or args[0] == "xpu": + if len(args) > 0 and (args[0] == "cuda" or args[0] == "xpu"): if "dtype" in kwargs: return original_autocast("xpu", *args[1:], **kwargs) else: