torch-mlir/lib/Dialect/Torch/Transforms
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
..
AbstractInterpLibrary.cpp [Torch] emit aten.dot and canonicalize it to aten.matmul (#3361) 2024-05-18 22:45:14 +08:00
AdjustCallingConventions.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
CMakeLists.txt [torch] Improve shape inference for `torch-to-linalg` path for reshapes (#3055) 2024-03-26 12:41:40 -07:00
DecomposeComplexOps.cpp [Torch] Fix bugs for `Torch::AtenOneHotOp` (#3350) 2024-05-22 17:19:08 +00:00
DropAbstractInterpCalculations.cpp Update to LLVM 029313cc979ae71877b65794b1063d4e51184cc8 2023-03-21 04:16:20 -07:00
EraseModuleInitializer.cpp update llvm to d23516e9ad477527a9db4d06b1fa9566680ac67c (#1812) 2023-01-23 16:34:22 -08:00
FuseQuantizedOps.cpp Expands Q Commuting Ops (#3332) 2024-05-13 11:01:53 -07:00
GlobalizeObjectGraph.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
InlineGlobalSlots.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
LowerToBackendContract.cpp [Torch] Decompose AtenMaskedScatterOp (#3353) 2024-05-16 15:27:25 +08:00
MatchQuantizedOps.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
MaximizeValueSemantics.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
PassDetail.h llvm: bump tag to e1318078 (#781) 2022-04-26 12:27:51 -07:00
Passes.cpp [Pipeline] Use dedicated simplification pipeline for TorchDynamo frontend (#3376) 2024-05-22 05:23:18 -07:00
PrepareForGlobalizeObjectGraph.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
RecomposeComplexOps.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
ReduceOpVariants.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
RefinePublicReturn.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
ReifyAbstractInterpCalculationsUtils.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
ReifyAbstractInterpCalculationsUtils.h handles 2,3,4 from https://github.com/llvm/torch-mlir/issues/1963 (#1964) 2023-03-24 21:50:01 -05:00
ReifyDtypeCalculations.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
ReifyShapeCalculations.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
ScalarizeShapes.cpp [torch] Improve shape inference for dynamic shapes (#3091) 2024-04-02 16:19:57 -07:00
SimplifyAbstractInterpCalculationsUtils.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
SimplifyAbstractInterpCalculationsUtils.h Replace RefineTypes with dtype functions (#2105) 2023-05-12 13:40:45 -07:00
SimplifyDtypeCalculations.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00
SimplifyShapeCalculations.cpp Fix deprecated uses of cast/dyn_cast/dyn_cast_or_null/isa (#3243) 2024-04-27 14:00:56 -07:00