From 7595f500e6f76bff509bbac015156e7e7148baf0 Mon Sep 17 00:00:00 2001 From: tenacious Date: Wed, 6 Nov 2024 15:07:41 +0800 Subject: [PATCH] change import level --- mmengine/registry/build_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmengine/registry/build_functions.py b/mmengine/registry/build_functions.py index b73f5c3d8c..fe907c80db 100644 --- a/mmengine/registry/build_functions.py +++ b/mmengine/registry/build_functions.py @@ -238,10 +238,10 @@ def build_optimizer_from_cfg( cfg: Union[dict, ConfigDict, Config], registry: Registry, default_args: Optional[Union[dict, ConfigDict, Config]] = None) -> Any: + from ..logging import print_log if 'type' in cfg \ and 'Adafactor' == cfg['type'] \ and digit_version(torch.__version__) >= digit_version('2.5.0'): - from ..logging import print_log print_log( 'the torch version of Adafactor is registered as TorchAdafactor') return build_from_cfg(cfg, registry, default_args)