From b4ba041aa564daf66cd72968fabff52e22e26863 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Fri, 21 Nov 2025 15:43:23 -0800 Subject: [PATCH] Futureproofing for imports Deprecation info: - https://docs.python.org/3.14/reference/datamodel.html#module.__package__ - https://docs.python.org/3.14/reference/datamodel.html#module.__loader__ - https://docs.python.org/3.14/reference/datamodel.html#module.__cached__ --- modules/intel/ipex/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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