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
chenpangpang
transformers
Commits
f09f42d4
Commit
f09f42d4
authored
Jan 27, 2020
by
Lysandre
Browse files
Input Embeddings should be assigned
cc @julien-c
parent
bac51fba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_xlnet.py
src/transformers/modeling_xlnet.py
+1
-1
No files found.
src/transformers/modeling_xlnet.py
View file @
f09f42d4
...
@@ -756,7 +756,7 @@ class XLNetModel(XLNetPreTrainedModel):
...
@@ -756,7 +756,7 @@ class XLNetModel(XLNetPreTrainedModel):
input_ids
=
input_ids
.
transpose
(
0
,
1
).
contiguous
()
input_ids
=
input_ids
.
transpose
(
0
,
1
).
contiguous
()
qlen
,
bsz
=
input_ids
.
shape
[
0
],
input_ids
.
shape
[
1
]
qlen
,
bsz
=
input_ids
.
shape
[
0
],
input_ids
.
shape
[
1
]
elif
inputs_embeds
is
not
None
:
elif
inputs_embeds
is
not
None
:
inputs_embeds
.
transpose
(
0
,
1
).
contiguous
()
inputs_embeds
=
inputs_embeds
.
transpose
(
0
,
1
).
contiguous
()
qlen
,
bsz
=
inputs_embeds
.
shape
[
0
],
inputs_embeds
.
shape
[
1
]
qlen
,
bsz
=
inputs_embeds
.
shape
[
0
],
inputs_embeds
.
shape
[
1
]
else
:
else
:
raise
ValueError
(
"You have to specify either input_ids or inputs_embeds"
)
raise
ValueError
(
"You have to specify either input_ids or inputs_embeds"
)
...
...
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