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
chenpangpang
transformers
Commits
909d4f1a
Commit
909d4f1a
authored
Jun 19, 2019
by
thomwolf
Browse files
cuda again
parent
14f0e8e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/bertology.py
examples/bertology.py
+1
-1
No files found.
examples/bertology.py
View file @
909d4f1a
...
@@ -218,7 +218,7 @@ def run_model():
...
@@ -218,7 +218,7 @@ def run_model():
print_2d_tensor
(
head_importance
)
print_2d_tensor
(
head_importance
)
logger
.
info
(
"Head ranked by importance scores"
)
logger
.
info
(
"Head ranked by importance scores"
)
head_ranks
=
torch
.
zeros
(
head_importance
.
numel
(),
dtype
=
torch
.
long
,
device
=
args
.
device
)
head_ranks
=
torch
.
zeros
(
head_importance
.
numel
(),
dtype
=
torch
.
long
,
device
=
args
.
device
)
head_ranks
[
head_importance
.
view
(
-
1
).
sort
(
descending
=
True
)[
1
]]
=
torch
.
arange
(
head_importance
.
numel
())
head_ranks
[
head_importance
.
view
(
-
1
).
sort
(
descending
=
True
)[
1
]]
=
torch
.
arange
(
head_importance
.
numel
()
,
device
=
args
.
device
)
head_ranks
=
head_ranks
.
view_as
(
head_importance
)
head_ranks
=
head_ranks
.
view_as
(
head_importance
)
print_2d_tensor
(
head_ranks
)
print_2d_tensor
(
head_ranks
)
...
...
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