torch-mlir/python/torch_mlir/extras
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
..
fx_importer.py [fx] Upstream the turbine FxImporter to torch-mlir. (#2681) 2023-12-21 08:40:10 -08:00
onnx_importer.py Fix onnx importer to treat Constant values as static (#2780) 2024-01-22 13:00:05 -08:00