Skip to content

Commit f9e7779

Browse files
committed
fix(cpp): address failing template deduction with some compilers
1 parent 36124db commit f9e7779

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quanto/library/ext/cpp/quantize.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ torch::Tensor quantize_symmetric_per_tensor(const torch::Tensor& input, const to
1212
float inv_scale = float_scale == 0 ? 1.0f : 1.0f / float_scale;
1313
for (const auto i : c10::irange(numel)) {
1414
int64_t qvalue = lrintf(std::nearbyint(data[i] * inv_scale));
15-
qvalue = std::max(-127LL, std::min(qvalue, 127LL));
15+
qvalue = std::max<int64_t>(-127LL, std::min<int64_t>(qvalue, 127LL));
1616
qdata[i] = static_cast<int8_t>(qvalue);
1717
}
1818
return output;

0 commit comments

Comments
 (0)