diff --git a/modules/intel/ipex/__init__.py b/modules/intel/ipex/__init__.py index 393c32164..726e5e742 100644 --- a/modules/intel/ipex/__init__.py +++ b/modules/intel/ipex/__init__.py @@ -50,8 +50,8 @@ def ipex_init(): # pylint: disable=too-many-statements torch.Tensor.is_cuda = torch.Tensor.is_xpu torch.nn.Module.cuda = torch.nn.Module.xpu torch.cuda.Optional = torch.xpu.Optional - torch.cuda.__cached__ = torch.xpu.__cached__ - torch.cuda.__loader__ = torch.xpu.__loader__ + torch.cuda.__cached__ = getattr(torch.xpu, "__cached__", None) + torch.cuda.__loader__ = getattr(torch.xpu, "__loader__", None) torch.cuda.streams = torch.xpu.streams torch.cuda.Any = torch.xpu.Any torch.cuda.__doc__ = torch.xpu.__doc__ @@ -62,7 +62,7 @@ def ipex_init(): # pylint: disable=too-many-statements torch.cuda.torch = torch.xpu.torch torch.cuda.Union = torch.xpu.Union torch.cuda.__annotations__ = torch.xpu.__annotations__ - torch.cuda.__package__ = torch.xpu.__package__ + torch.cuda.__package__ = getattr(torch.xpu, "__package__", None) torch.cuda.__builtins__ = torch.xpu.__builtins__ torch.cuda._lazy_init = torch.xpu._lazy_init torch.cuda.StreamContext = torch.xpu.StreamContext