From 206f04c9946a1323f7eaaa145686dcf8fe3e6d8c Mon Sep 17 00:00:00 2001 From: Yuting Zhao Date: Wed, 25 May 2022 22:17:46 +0800 Subject: [PATCH] Add type hint --- mmcv/runner/builder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mmcv/runner/builder.py b/mmcv/runner/builder.py index 77c96ba0b2f..df2534d5c16 100644 --- a/mmcv/runner/builder.py +++ b/mmcv/runner/builder.py @@ -1,5 +1,6 @@ # Copyright (c) OpenMMLab. All rights reserved. import copy +from typing import Optional from ..utils import Registry @@ -7,11 +8,11 @@ RUNNER_BUILDERS = Registry('runner builder') -def build_runner_constructor(cfg): +def build_runner_constructor(cfg: dict): return RUNNER_BUILDERS.build(cfg) -def build_runner(cfg, default_args=None): +def build_runner(cfg: dict, default_args: Optional[dict] =None): runner_cfg = copy.deepcopy(cfg) constructor_type = runner_cfg.pop('constructor', 'DefaultRunnerConstructor')