Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
0b78b8c3
Unverified
Commit
0b78b8c3
authored
Jul 07, 2020
by
Ningxin Zheng
Committed by
GitHub
Jul 07, 2020
Browse files
[bug bash] fix a small bug. (#2649)
parent
5cbe425f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/sdk/pynni/nni/compression/torch/pruning/structured_pruning.py
...pynni/nni/compression/torch/pruning/structured_pruning.py
+2
-1
No files found.
src/sdk/pynni/nni/compression/torch/pruning/structured_pruning.py
View file @
0b78b8c3
...
...
@@ -263,11 +263,12 @@ class ActivationAPoZRankFilterPrunerMasker(ActivationFilterPrunerMasker):
base_mask
[
'weight_mask'
][
idx
]
=
0.
if
base_mask
[
'bias_mask'
]
is
not
None
:
base_mask
[
'bias_mask'
][
idx
]
=
0.
return
base_mask
if
len
(
activations
)
>=
self
.
statistics_batch_num
and
self
.
pruner
.
hook_id
in
self
.
pruner
.
_fwd_hook_handles
:
self
.
pruner
.
remove_activation_collector
(
self
.
pruner
.
hook_id
)
return
base_mask
def
_calc_apoz
(
self
,
activations
):
"""
Calculate APoZ(average percentage of zeros) of activations.
...
...
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