NNCF silence the pytorch version warning

This commit is contained in:
Disty0
2025-05-09 23:16:55 +03:00
parent b0e5a6c4df
commit 1ee9832e05
4 changed files with 19 additions and 6 deletions
+5
View File
@@ -268,6 +268,11 @@ def load_nncf(msg='', silent=False):
try:
import nncf
intel_nncf = nncf
try:
# silence the pytorch version warning
nncf.common.logging.logger.warn_bkc_version_mismatch = lambda *args, **kwargs: None
except Exception:
pass
fn = f'{sys._getframe(2).f_code.co_name}:{sys._getframe(1).f_code.co_name}' # pylint: disable=protected-access
log.debug(f'Quantization: type=nncf version={nncf.__version__} fn={fn}') # pylint: disable=protected-access
return intel_nncf