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
nni
Commits
2fc3f0b3
Unverified
Commit
2fc3f0b3
authored
Aug 19, 2021
by
chenbohua3
Committed by
GitHub
Aug 19, 2021
Browse files
no necessary to use pretrained model in pruner ut (#4085)
parent
6d9c49da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test/ut/sdk/test_dependecy_aware.py
test/ut/sdk/test_dependecy_aware.py
+2
-2
No files found.
test/ut/sdk/test_dependecy_aware.py
View file @
2fc3f0b3
...
...
@@ -79,7 +79,7 @@ class DependencyawareTest(TestCase):
print
(
'Testing on '
,
pruner
)
ori_filters
=
{}
Model
=
getattr
(
models
,
model_name
)
net
=
Model
(
pretrained
=
Tru
e
,
progress
=
False
)
net
=
Model
(
pretrained
=
Fals
e
,
progress
=
False
)
# record the number of the filter of each conv layer
for
name
,
module
in
net
.
named_modules
():
if
isinstance
(
module
,
nn
.
Conv2d
):
...
...
@@ -127,7 +127,7 @@ class DependencyawareTest(TestCase):
Model
=
getattr
(
models
,
model_name
)
cfg_generator
=
[
generate_random_sparsity
,
generate_random_sparsity_v2
]
for
_generator
in
cfg_generator
:
net
=
Model
(
pretrained
=
Tru
e
,
progress
=
False
)
net
=
Model
(
pretrained
=
Fals
e
,
progress
=
False
)
cfg_list
=
_generator
(
net
)
print
(
'
\n\n
Model:'
,
model_name
)
...
...
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