Unverified Commit a1ea3adb authored by Nishant Prabhu's avatar Nishant Prabhu Committed by GitHub
Browse files

Fix LayoutLM ONNX test error (#13710)

Fix LayoutLM ONNX test error
parent 3a8a8013
......@@ -42,6 +42,7 @@ Ready-made configurations include the following models:
- BERT
- DistilBERT
- GPT-2
- LayoutLM
- RoBERTa
- T5
- XLM-RoBERTa
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment