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
7c4e81b5
Commit
7c4e81b5
authored
Nov 11, 2019
by
Tang Lang
Committed by
QuanluZhang
Nov 11, 2019
Browse files
fix pruner export (#1727)
parent
b37fbca8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/sdk/pynni/nni/compression/torch/compressor.py
src/sdk/pynni/nni/compression/torch/compressor.py
+2
-0
No files found.
src/sdk/pynni/nni/compression/torch/compressor.py
View file @
7c4e81b5
...
@@ -206,6 +206,8 @@ class Pruner(Compressor):
...
@@ -206,6 +206,8 @@ class Pruner(Compressor):
"""
"""
assert
model_path
is
not
None
,
'model_path must be specified'
assert
model_path
is
not
None
,
'model_path must be specified'
for
name
,
m
in
self
.
bound_model
.
named_modules
():
for
name
,
m
in
self
.
bound_model
.
named_modules
():
if
name
==
""
:
continue
mask
=
self
.
mask_dict
.
get
(
name
)
mask
=
self
.
mask_dict
.
get
(
name
)
if
mask
is
not
None
:
if
mask
is
not
None
:
mask_sum
=
mask
.
sum
().
item
()
mask_sum
=
mask
.
sum
().
item
()
...
...
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