Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
84a544fb
Unverified
Commit
84a544fb
authored
May 27, 2022
by
Yvette Zhao
Committed by
GitHub
May 27, 2022
Browse files
Add type hints for runner/builder (#1985)
parent
ef2b927b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
mmcv/runner/builder.py
mmcv/runner/builder.py
+3
-2
No files found.
mmcv/runner/builder.py
View file @
84a544fb
# Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) OpenMMLab. All rights reserved.
import
copy
import
copy
from
typing
import
Optional
from
..utils
import
Registry
from
..utils
import
Registry
...
@@ -7,11 +8,11 @@ RUNNERS = Registry('runner')
...
@@ -7,11 +8,11 @@ RUNNERS = Registry('runner')
RUNNER_BUILDERS
=
Registry
(
'runner builder'
)
RUNNER_BUILDERS
=
Registry
(
'runner builder'
)
def
build_runner_constructor
(
cfg
):
def
build_runner_constructor
(
cfg
:
dict
):
return
RUNNER_BUILDERS
.
build
(
cfg
)
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
)
runner_cfg
=
copy
.
deepcopy
(
cfg
)
constructor_type
=
runner_cfg
.
pop
(
'constructor'
,
constructor_type
=
runner_cfg
.
pop
(
'constructor'
,
'DefaultRunnerConstructor'
)
'DefaultRunnerConstructor'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment