From 85acd368e2404e9b6f9adee62b39b478c616e5a1 Mon Sep 17 00:00:00 2001 From: David Corvoysier Date: Fri, 9 Feb 2024 16:30:38 +0000 Subject: [PATCH] fix(cpp): address failing template deduction with some compilers --- quanto/library/ext/cpp/quantize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quanto/library/ext/cpp/quantize.cpp b/quanto/library/ext/cpp/quantize.cpp index dfddfe24..c210e791 100644 --- a/quanto/library/ext/cpp/quantize.cpp +++ b/quanto/library/ext/cpp/quantize.cpp @@ -12,7 +12,7 @@ torch::Tensor quantize_symmetric_per_tensor(const torch::Tensor& input, const to float inv_scale = float_scale == 0 ? 1.0f : 1.0f / float_scale; for (const auto i : c10::irange(numel)) { int64_t qvalue = lrintf(std::nearbyint(data[i] * inv_scale)); - qvalue = std::max(-127LL, std::min(qvalue, 127LL)); + qvalue = std::max(-127LL, std::min(qvalue, 127LL)); qdata[i] = static_cast(qvalue); } return output;