Skip to content
Snippets Groups Projects
Unverified Commit 1e79b974 authored by Zaida Zhou's avatar Zaida Zhou Committed by GitHub
Browse files

Mock unimplemented modules and fix unit tests (#54)

* Mock unimplemented modules and fix unit tests

* add a comment
parent 92de63ee
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,18 @@
import itertools
import math
from typing import Iterator, Optional, Sized
# from mmengine.dist import get_dist_info, sync_random_seed
from unittest.mock import MagicMock
import torch
from torch.utils.data import Sampler
from mmengine.dist import get_dist_info, sync_random_seed
from mmengine.registry import DATA_SAMPLERS
# TODO, need to remove those lines after implementing dist module
get_dist_info = MagicMock(return_value=(0, 1))
sync_random_seed = MagicMock(return_value=0)
@DATA_SAMPLERS.register_module()
class DefaultSampler(Sampler[int]):
......
[pytest]
testpaths = tests
norecursedirs = tests/data
norecursedirs =
tests/data
tests/test_visualizer
......@@ -178,7 +178,9 @@ class TestBuilder(TestCase):
assert sub_gn_bias['lr'] == self.base_lr
assert sub_gn_bias['weight_decay'] == self.base_wd * norm_decay_mult
if torch.cuda.is_available():
# test dcn which requires cuda is available and
# mmcv-full has been installed
if torch.cuda.is_available() and MMCV_FULL_AVAILABLE:
dcn_conv_weight = param_groups[11]
assert dcn_conv_weight['lr'] == self.base_lr
assert dcn_conv_weight['weight_decay'] == self.base_wd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment