mirror of
https://github.com/open-mmlab/mmengine.git
synced 2025-06-03 21:54:44 +08:00
* [Feature]: Add Part3 of Hooks * [Feature]: Add Hook * [Fix]: Add docstring and type hint for base hook * add sync buffer hook * update typing hint and docs * fix lint * fix mypy * fix lint * use mock from unittest Co-authored-by: seuyou <3463423099@qq.com>
14 lines
311 B
Python
14 lines
311 B
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
from unittest.mock import Mock
|
|
|
|
from mmengine.hooks import SyncBuffersHook
|
|
|
|
|
|
class TestSyncBuffersHook:
|
|
|
|
def test_sync_buffers_hook(self):
|
|
Runner = Mock()
|
|
Runner.model = Mock()
|
|
Hook = SyncBuffersHook()
|
|
Hook.after_epoch(Runner)
|