torch-mlir/lib/Conversion
lonely eagle e581b33f96
[Stablehlo]fix CumsumInputDtypeInt32Module_basic on stablehlo backend. (#2797)
Code used for testing.For the location of CumsumInputDtypeInt32Module in
the repo you can see
[here](311b6b0286/projects/pt1/python/torch_mlir_e2e_test/test_suite/basic.py (L4148)).
```python
import torch
import torch_mlir

class CumsumInputDtypeInt32Module(torch.nn.Module):

    def __init__(self):
        super().__init__()

    def forward(self, val):
        return torch.ops.aten.cumsum(val, 1)
module = torch_mlir.compile(CumsumInputDtypeInt32Module(), [torch.randn(2, 7, 4).to(torch.int32)], output_type="stablehlo")
print(module.operation.get_asm())
```
After fixing the bugs.
```
module attributes {torch.debug_module_name = "CumsumInputDtypeInt32Module"} {
  func.func @forward(%arg0: tensor<2x7x4xi32>) -> tensor<2x7x4xi64> {
    %0 = stablehlo.constant dense<0> : tensor<i64>
    %1 = stablehlo.convert %arg0 : (tensor<2x7x4xi32>) -> tensor<2x7x4xi64>
    %2 = "stablehlo.reduce_window"(%1, %0) ({
    ^bb0(%arg1: tensor<i64>, %arg2: tensor<i64>):
      %3 = stablehlo.add %arg1, %arg2 : tensor<i64>
      stablehlo.return %3 : tensor<i64>
    }) {padding = dense<[[0, 0], [6, 0], [0, 0]]> : tensor<3x2xi64>, window_dilations = dense<1> : tensor<3xi64>, window_dimensions = dense<[1, 7, 1]> : tensor<3xi64>, window_strides = dense<1> : tensor<3xi64>} : (tensor<2x7x4xi64>, tensor<i64>) -> tensor<2x7x4xi64>
    return %2 : tensor<2x7x4xi64>
  }
}
```
2024-01-25 10:44:08 +08:00
..
TorchConversionToMLProgram Re-organize project structure to separate PyTorch dependencies from core project. (#2542) 2023-11-02 19:45:55 -07:00
TorchOnnxToTorch [onnx] Lower `onnx.QLinearMatMul` lowering to `torch` operators (#2776) 2024-01-24 12:28:48 -08:00
TorchToArith Fix for unused variable failure when trying to bump torch-mlir in IREE (#2560) 2023-11-08 15:55:41 -08:00
TorchToLinalg [torch][quant] Quantized `torch.mm` for linalg with end-to-end test (#2750) 2024-01-24 14:02:50 -08:00
TorchToSCF Re-organize project structure to separate PyTorch dependencies from core project. (#2542) 2023-11-02 19:45:55 -07:00
TorchToStablehlo [Stablehlo]fix CumsumInputDtypeInt32Module_basic on stablehlo backend. (#2797) 2024-01-25 10:44:08 +08:00
TorchToTMTensor Re-organize project structure to separate PyTorch dependencies from core project. (#2542) 2023-11-02 19:45:55 -07:00
TorchToTensor [onnx] Lowering for `onnx.shape` to `torch` and `tensor` (#2648) 2023-12-15 11:37:49 -08:00
TorchToTosa Do not try to legalize transposed convolution (#2721) 2024-01-22 10:57:56 -08:00
Utils [Torch Dialect]Support aten.cosine_similarity (#2364) 2023-11-08 15:28:30 +08:00
CMakeLists.txt [onnx] Lowering for `onnx.shape` to `torch` and `tensor` (#2648) 2023-12-15 11:37:49 -08:00
PassDetail.h Minor fixes for `ConvertTorchConversionToMLProgram`. (#1991) 2023-04-04 09:09:58 -07:00
Passes.cpp [onnx] Lowering for `onnx.shape` to `torch` and `tensor` (#2648) 2023-12-15 11:37:49 -08:00