-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
register_buffer
to save prototype vectors and add a progress bar
during preparing prototype.
- Loading branch information
Showing
4 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from .collect_env import collect_env | ||
from .progress import track_on_main_process | ||
from .setup_env import register_all_modules | ||
|
||
__all__ = ['collect_env', 'register_all_modules'] | ||
__all__ = ['collect_env', 'register_all_modules', 'track_on_main_process'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
import mmengine.dist as dist | ||
import rich.progress as progress | ||
|
||
|
||
def track_on_main_process(sequence, *args, **kwargs): | ||
if not dist.is_main_process(): | ||
return sequence | ||
|
||
yield from progress.track(sequence, *args, **kwargs) |