Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
llvm
distiller
Commits
e564a05f
Commit
e564a05f
authored
6 years ago
by
Neta Zmora
Browse files
Options
Downloads
Patches
Plain Diff
CPU support: fix thinning directive tensor migration to CPU/GPU
parent
81cb77d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
distiller/thinning.py
+2
-2
2 additions, 2 deletions
distiller/thinning.py
with
2 additions
and
2 deletions
distiller/thinning.py
+
2
−
2
View file @
e564a05f
...
...
@@ -474,7 +474,7 @@ def execute_thinning_recipe(model, zeros_mask_dict, recipe, optimizer, loaded_fr
This will remove filters and channels, as well as handle batch-normalization parameter
adjustment, and thinning of weight tensors.
"""
device
=
distiller
.
utils
.
model_device
(
model
)
layers
=
{
mod_name
:
m
for
mod_name
,
m
in
model
.
named_modules
()}
for
layer_name
,
directives
in
recipe
.
modules
.
items
():
for
attr
,
val
in
directives
.
items
():
...
...
@@ -500,7 +500,7 @@ def execute_thinning_recipe(model, zeros_mask_dict, recipe, optimizer, loaded_fr
assert
param
is
not
None
for
directive
in
param_directives
:
dim
=
directive
[
0
]
indices
=
directive
[
1
]
indices
=
directive
[
1
]
.
to
(
device
)
len_indices
=
indices
.
nelement
()
if
len
(
directive
)
==
4
:
# TODO: this code is hard to follow
msglogger
.
debug
(
"
{}-{}-{}: SHAPE = {}
"
.
format
(
param_name
,
param
.
shape
,
id
(
param
),
list
(
directive
[
2
])))
...
...
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