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
cb8f6755
Unverified
Commit
cb8f6755
authored
Jun 20, 2023
by
Sergii Dymchenko
Committed by
GitHub
Jun 20, 2023
Browse files
Update deprecated torch.ger (#24387)
parent
eb849f66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/transfo_xl/modeling_transfo_xl.py
src/transformers/models/transfo_xl/modeling_transfo_xl.py
+1
-1
No files found.
src/transformers/models/transfo_xl/modeling_transfo_xl.py
View file @
cb8f6755
...
@@ -185,7 +185,7 @@ class PositionalEmbedding(nn.Module):
...
@@ -185,7 +185,7 @@ class PositionalEmbedding(nn.Module):
self
.
register_buffer
(
"inv_freq"
,
inv_freq
)
self
.
register_buffer
(
"inv_freq"
,
inv_freq
)
def
forward
(
self
,
pos_seq
,
bsz
=
None
):
def
forward
(
self
,
pos_seq
,
bsz
=
None
):
sinusoid_inp
=
torch
.
g
er
(
pos_seq
,
self
.
inv_freq
)
sinusoid_inp
=
torch
.
out
er
(
pos_seq
,
self
.
inv_freq
)
pos_emb
=
torch
.
cat
([
sinusoid_inp
.
sin
(),
sinusoid_inp
.
cos
()],
dim
=-
1
)
pos_emb
=
torch
.
cat
([
sinusoid_inp
.
sin
(),
sinusoid_inp
.
cos
()],
dim
=-
1
)
if
bsz
is
not
None
:
if
bsz
is
not
None
:
...
...
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