Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update on "[ONNX] handle aten::_set_item on Dict in convertInplaceOps…
…AndTrackAlias (#58317)" It seems the JIT produces an output for aten::_set_item on lists but not on dicts. Previously the code would crash because it assumed it was operating on a list. The different behavior can be seen with the following test: ```python class DictModule(torch.nn.Module): def forward(self, x_in: torch.Tensor) -> typing.Dict[str, torch.Tensor]: x_out = {} x_out["test_key_out"] = x_in return x_out x_in = torch.tensor(1) dms = torch.jit.script(DictModule()) torch.onnx.export(dms, (x_in,), "/dev/null", example_outputs=(dms(x_in),)) ``` Before this change: `RuntimeError: outputs_.size() == 1INTERNAL ASSERT FAILED at "../torch/csrc/jit/ir/ir.h":452, please report a bug to PyTorch.` After this change: `RuntimeError: Exporting the operator prim_DictConstruct to ONNX opset version 9 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.` This is a more useful error message. Co-authored-by: Gary Miguel <garymiguel@microsoft.com> Differential Revision: [D28714804](https://our.internmc.facebook.com/intern/diff/D28714804) [ghstack-poisoned]
- Loading branch information