torch-mlir/lib/Conversion/TorchOnnxToTorch
Angel Zhang 2e194e13d6
[Torch] Fix bugs for `Torch::AtenOneHotOp` (#3350)
This PR fixes the bugs for `Torch::AtenOneHotOp` by:

1) Using `Torch::kUnknownSize` as the default value for `numClasses` in
   the pattern matching stage in `DecomposeAtenOneHotOp`
2) Adding `AtenIntScalarOp` to the patterns in `TorchToArith`
3) Handling both `int` and `float` types for `off` and `on` values in
`TorchOnnxToTorch` conversion

It also includes:

1) A new test in `TorchToArith/basic.mlir`, for `torch.aten.Int.Scalar`,
and
2) A new test in `decompose-complex-ops.mlir`, for `torch.aten.one_hot`

**Dependencies**

This PR is dependent on #3334.
2024-05-22 17:19:08 +00:00
..
CMakeLists.txt [ONNX] Support onnx.LSTM (#2969) 2024-04-08 12:23:33 -07:00
DefaultDomainAtoF.cpp Add attributes support for onnx cumsum op (#3241) 2024-05-11 02:09:01 +08:00
DefaultDomainGtoP.cpp [Torch] Fix bugs for `Torch::AtenOneHotOp` (#3350) 2024-05-22 17:19:08 +00:00
DefaultDomainQtoZ.cpp [ONNX] Implement Softsign op (#3373) 2024-05-21 12:10:26 -07:00
OnnxLstmExpander.cpp [ONNX] Support onnx.LSTM (#2969) 2024-04-08 12:23:33 -07:00
PassDetail.h Initial TorchOnnxToTorch conversion pipeline. (#2585) 2023-11-21 21:02:55 -08:00
Passes.cpp Initial TorchOnnxToTorch conversion pipeline. (#2585) 2023-11-21 21:02:55 -08:00
Patterns.cpp Initial TorchOnnxToTorch conversion pipeline. (#2585) 2023-11-21 21:02:55 -08:00
TorchOnnxToTorch.cpp Initial TorchOnnxToTorch conversion pipeline. (#2585) 2023-11-21 21:02:55 -08:00
Utils.cpp [onnx] Add `onnx-to-torch` lowering for random ops (#3193) 2024-04-22 22:28:07 +05:30