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
a1ea3adb
Unverified
Commit
a1ea3adb
authored
Sep 29, 2021
by
Nishant Prabhu
Committed by
GitHub
Sep 29, 2021
Browse files
Fix LayoutLM ONNX test error (#13710)
Fix LayoutLM ONNX test error
parent
3a8a8013
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
docs/source/serialization.rst
docs/source/serialization.rst
+1
-0
src/transformers/models/layoutlm/configuration_layoutlm.py
src/transformers/models/layoutlm/configuration_layoutlm.py
+2
-7
No files found.
docs/source/serialization.rst
View file @
a1ea3adb
...
...
@@ -42,6 +42,7 @@ Ready-made configurations include the following models:
-
BERT
-
DistilBERT
-
GPT
-
2
-
LayoutLM
-
RoBERTa
-
T5
-
XLM
-
RoBERTa
...
...
src/transformers/models/layoutlm/configuration_layoutlm.py
View file @
a1ea3adb
...
...
@@ -183,11 +183,6 @@ class LayoutLMOnnxConfig(OnnxConfig):
raise
ValueError
(
"Cannot generate dummy inputs without PyTorch installed."
)
import
torch
input_dict
[
"bbox"
]
=
torch
.
tensor
(
[
[
0
]
*
4
,
*
[
box
]
*
seq_length
,
[
self
.
max_2d_positions
]
*
4
,
]
).
tile
(
batch_size
,
1
,
1
)
batch_size
,
seq_length
=
input_dict
[
"input_ids"
].
shape
input_dict
[
"bbox"
]
=
torch
.
tensor
([
*
[
box
]
*
seq_length
]).
tile
(
batch_size
,
1
,
1
)
return
input_dict
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