Control sys.modules ipex duplicate check with BIGDL_CHECK_DUPLICATE_IMPORT (#11453)

* Control sys.modules ipex duplicate check with BIGDL_CHECK_DUPLICATE_IMPORT。
This commit is contained in:
Qiyuan Gong 2024-06-27 17:21:45 +08:00 committed by GitHub
parent c6e5ad668d
commit 4e4ecd5095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,7 @@ class IPEXImporter:
"""
if self.is_xpu_version_installed():
# Check if user import ipex manually
if BIGDL_CHECK_DUPLICATE_IMPORT:
if 'ipex' in sys.modules or 'intel_extension_for_pytorch' in sys.modules:
log4Error.invalidInputError(False,
ipex_duplicate_import_error)