Skip to content

Commit 2885dca

Browse files
authored
Avoid configuring the root logger on import (#2539)
1 parent d828f91 commit 2885dca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchao/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
except PackageNotFoundError:
2121
__version__ = "unknown" # In case this logic breaks don't break the build
2222

23+
logger = logging.getLogger(__name__)
24+
2325
try:
2426
from pathlib import Path
2527

@@ -36,7 +38,7 @@
3638
# For more information, see https://github.com/pytorch/ao/blob/main/torchao/experimental/docs/readme.md
3739
from torchao.experimental.op_lib import * # noqa: F403
3840
except Exception as e:
39-
logging.debug(f"Skipping import of cpp extensions: {e}")
41+
logger.debug(f"Skipping import of cpp extensions: {e}")
4042

4143
from torchao.quantization import (
4244
autoquant,

0 commit comments

Comments
 (0)