torch-mlir/python/torch_mlir
Dave Liddell d452c4f4c0
Fix onnx importer to treat Constant values as static (#2780)
Fixes  https://github.com/llvm/torch-mlir/issues/2764

In the case of OPT, there are ConstantOfShape ops whose input shape is
not static (that is, an initializer), but rather comes from a Constant
op. The importer can't handle such non-static input shapes.

The fix here is to create initializers for a subset of Constant ops
(ones with "value" attributes), so that their outputs can be used
statically. Additionally, there was no case for creating a splat of
int64, so I added that as well.

---------

Co-authored-by: Dave Liddell <dliddell@xilinx.com>
2024-01-22 13:00:05 -08:00
..
dialects Upstream the ONNX importer. (#2636) 2023-12-12 19:02:51 -08:00
extras Fix onnx importer to treat Constant values as static (#2780) 2024-01-22 13:00:05 -08:00
tools/import_onnx [onnx] Add torch-mlir-import-onnx tool. (#2637) 2023-12-12 22:01:30 -08:00