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
118ecfd4
"vscode:/vscode.git/clone" did not exist on "ed302a73f4cc365db4cd29d26ca722d605bc85a1"
Unverified
Commit
118ecfd4
authored
Aug 06, 2020
by
Patrick von Platen
Committed by
GitHub
Aug 06, 2020
Browse files
fix for pytorch < 1.6 (#6300)
parent
2804fff8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_reformer.py
src/transformers/modeling_reformer.py
+2
-2
No files found.
src/transformers/modeling_reformer.py
View file @
118ecfd4
...
...
@@ -1400,7 +1400,7 @@ class ReformerLayer(nn.Module):
# randomize seeds
# use cuda generator if available
if
len
(
torch
.
cuda
.
default_generators
)
>
0
:
if
hasattr
(
torch
.
cuda
,
"default_generators"
)
and
len
(
torch
.
cuda
.
default_generators
)
>
0
:
# GPU
device_idx
=
torch
.
cuda
.
current_device
()
self
.
attention_seed
=
torch
.
cuda
.
default_generators
[
device_idx
].
seed
()
...
...
@@ -1420,7 +1420,7 @@ class ReformerLayer(nn.Module):
"""
# randomize seeds
# use cuda generator if available
if
len
(
torch
.
cuda
.
default_generators
)
>
0
:
if
hasattr
(
torch
.
cuda
,
"default_generators"
)
and
len
(
torch
.
cuda
.
default_generators
)
>
0
:
# GPU
device_idx
=
torch
.
cuda
.
current_device
()
self
.
feed_forward_seed
=
torch
.
cuda
.
default_generators
[
device_idx
].
seed
()
...
...
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