Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICV-mmengine_basecode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Schiffel
ICV-mmengine_basecode
Commits
1e79b974
Unverified
Commit
1e79b974
authored
3 years ago
by
Zaida Zhou
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mmengine/data/sampler.py
+6
-1
6 additions, 1 deletion
mmengine/data/sampler.py
pytest.ini
+3
-1
3 additions, 1 deletion
pytest.ini
tests/test_optim/test_optimizer/test_optimizer.py
+3
-1
3 additions, 1 deletion
tests/test_optim/test_optimizer/test_optimizer.py
with
12 additions
and
3 deletions
mmengine/data/sampler.py
+
6
−
1
View file @
1e79b974
...
...
@@ -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
]):
...
...
This diff is collapsed.
Click to expand it.
pytest.ini
+
3
−
1
View file @
1e79b974
[pytest]
testpaths
=
tests
norecursedirs
=
tests/data
norecursedirs
=
tests/data
tests/test_visualizer
This diff is collapsed.
Click to expand it.
tests/test_optim/test_optimizer/test_optimizer.py
+
3
−
1
View file @
1e79b974
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment