pytorch
1829268e - [ONNX] Improve error message for parse_arg in symbolic functions (#50512) (#51516)

Commit
3 years ago
[ONNX] Improve error message for parse_arg in symbolic functions (#50512) (#51516) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/51516 previous error message looks like this ``` RuntimeError: Unexpected node type: onnx::Gather ``` now ``` RuntimeError: Expected node type 'onnx::Constant' for argument 'groups' of node 'conv1d', got 'onnx::Gather'. ``` Repro example: ```python torch.jit.script def conv(x, w): return F.conv1d(x, w, groups=x.shape[0]) class Net(nn.Module): def forward(self, x, w): return conv(x, w) model = Net() x = torch.randn(8, 8, 512) w = torch.randn(8, 1, 3) torch.onnx.export(model, (x, w), "file.onnx", opset_version=12) ``` Test Plan: Imported from OSS Reviewed By: pbelevich Differential Revision: D26203118 Pulled By: SplitInfinity fbshipit-source-id: 607b22f4cba4baa24154f197914b6817449ab9f8
Author
Parents
Loading