torch-mlir/python/test
Sean Silva 64914603fa [torch_mlir.compile] Add support for multiple exported methods
For AoT deployments models often have multiple exported methods.
This patch enables something like this:

```
class TwoMethodsModule(torch.nn.Module):
    def sin(self, x):
        return torch.ops.aten.sin(x)

    def cos(self, x):
        return torch.ops.aten.cos(x)

example_args = torch_mlir.ExampleArgs()
example_args.add_method("sin", torch.ones(2, 3))
example_args.add_method("cos", torch.ones(2, 4))
print(torch_mlir.compile(TwoMethodsModule(), example_args))
```

In the
[long-term](https://github.com/llvm/torch-mlir/blob/main/docs/long_term_roadmap.md#tools-for-advanced-aot-deployments)
we will need to reconcile this with our story for stateful models and the
backend contract being purely functional. For now, this provides some basic
infra that seems harmless. Arguably, we could tighten up the backend contract
even more to only allow a single compiled function which would prohibit this or
require building out a layer above.

Fixes #1557
2022-11-10 02:10:22 -08:00
..
compile_api [torch_mlir.compile] Add support for multiple exported methods 2022-11-10 02:10:22 -08:00
eager_mode Clean up Autogen (#1112) 2022-07-30 09:40:02 -04:00
lazy_backend Fix LTC lib_torch_mlir_ltc.so import error (#1283) 2022-08-25 18:25:01 -04:00
torchscript_e2e_test Remove "torchscript" association from the e2e framework. 2022-08-29 14:10:03 -07:00
CMakeLists.txt Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
annotations-sugar.py Remove "torchscript" association from the e2e framework. 2022-08-29 14:10:03 -07:00
lit.cfg.py Miscellaneous fixes for Windows builds (#1376) 2022-09-29 12:07:43 -05:00
lit.site.cfg.py.in Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00