mirror of https://github.com/llvm/torch-mlir
689b40c7a6
It turns out that this was easiest to structure as a general IValue importer, since torch module are just one of the possible IValue's. We import the IValue object graph in a braindead fashion into basicpy ops and a new `torch.nn_module` op that is used to model the attributes/methods of a torch::jit::Module IValue. See `Torch/ops.mlir` for an example, and also check out the .py import tests in `frontends/pytorch/test/module_import`. As part of this change, a few housekeeping tasks: - extract some helpers from graph_importer.cpp - more helpers around the C API - misc touchups |
||
---|---|---|
.. | ||
acap_dispatch.cpp | ||
acap_dispatch.h | ||
debug.cpp | ||
debug.h | ||
func_builder.cpp | ||
func_builder.h | ||
graph_importer.cpp | ||
graph_importer.h | ||
ivalue_importer.cpp | ||
ivalue_importer.h | ||
mlir_utils.h | ||
module_builder.cpp | ||
module_builder.h | ||
python_bindings.cpp | ||
torch_to_mlir_utils.cpp | ||
torch_to_mlir_utils.h |