From fadd3ea31b035c287c031a2f4c03e1724ba31e48 Mon Sep 17 00:00:00 2001 From: Tanyo Kwok Date: Wed, 22 Jun 2022 11:36:58 +0800 Subject: [PATCH] fix divide_floor & export promoteTypes api (#9) --- include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h | 1 + lib/Dialect/Torch/Utils/TorchUpstream.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h b/include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h index d6bc0a699172..1a87cdabd458 100644 --- a/include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h +++ b/include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h @@ -160,6 +160,7 @@ enum Layout { Strided, Sparse, SparseCsr, Mkldnn, NumOptions }; //===-----------------------------------------------------------------------===// enum EmbeddingBagMode { MODE_SUM, MODE_MEAN, MODE_MAX }; +ScalarType promoteTypes(ScalarType a, ScalarType b); } // namespace torch_upstream } // namespace torch } // namespace mlir diff --git a/lib/Dialect/Torch/Utils/TorchUpstream.cpp b/lib/Dialect/Torch/Utils/TorchUpstream.cpp index 37ffffabd8fd..6cd6f1e1143d 100644 --- a/lib/Dialect/Torch/Utils/TorchUpstream.cpp +++ b/lib/Dialect/Torch/Utils/TorchUpstream.cpp @@ -26,7 +26,7 @@ static inline bool isQIntType(ScalarType t) { // Type promotion related code are copied from // aten/src/ATen/native/TypeProperties.*. //===----------------------------------------------------------------------===// -static inline ScalarType promoteTypes(ScalarType a, ScalarType b) { +ScalarType promoteTypes(ScalarType a, ScalarType b) { // This is generated according to NumPy's promote_types constexpr auto u1 = ScalarType::Byte; constexpr auto i1 = ScalarType::Char;