From 2232780216ca573499bb21292631da488c40c1b2 Mon Sep 17 00:00:00 2001 From: Max Dawkins Date: Thu, 15 Feb 2024 14:25:49 -0500 Subject: [PATCH] Added TorchToLinalg conversion for Aten_LocalScalarDenseOp --- include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td | 2 +- lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td b/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td index 7430f587f..b7ce444f6 100644 --- a/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td +++ b/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td @@ -10324,7 +10324,7 @@ def Torch_Aten_LocalScalarDenseOp : Torch_Op<"aten._local_scalar_dense", [ ]> { let summary = "Generated op for `aten::_local_scalar_dense : (Tensor) -> (Scalar)`"; let arguments = (ins - AnyTorchTensorType:$self + AnyTorchTensorType:$a ); let results = (outs AnyTorchScalarType:$result diff --git a/lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp b/lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp index a1e8e5fb7..54c0c794d 100644 --- a/lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp +++ b/lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp @@ -213,13 +213,16 @@ void mlir::torch::torch_to_linalg:: patterns.add(typeConverter, context); target.addIllegalOp(); patterns.add(typeConverter, context); - target.addIllegalOp(); + target.addIllegalOp(); patterns.add>(typeConverter, context); patterns.add>( typeConverter, context); patterns.add>(typeConverter, context); + patterns.add>( + typeConverter, context); target.addIllegalOp(); patterns.add(typeConverter, context); target.addIllegalOp();