Skip to content

Commit

Permalink
Add type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
ytzhao committed May 25, 2022
1 parent 05bdd16 commit 206f04c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mmcv/runner/builder.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Copyright (c) OpenMMLab. All rights reserved.
import copy
from typing import Optional

from ..utils import Registry

RUNNERS = Registry('runner')
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')
Expand Down

0 comments on commit 206f04c

Please sign in to comment.