We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36124db commit f9e7779Copy full SHA for f9e7779
quanto/library/ext/cpp/quantize.cpp
@@ -12,7 +12,7 @@ torch::Tensor quantize_symmetric_per_tensor(const torch::Tensor& input, const to
12
float inv_scale = float_scale == 0 ? 1.0f : 1.0f / float_scale;
13
for (const auto i : c10::irange(numel)) {
14
int64_t qvalue = lrintf(std::nearbyint(data[i] * inv_scale));
15
- qvalue = std::max(-127LL, std::min(qvalue, 127LL));
+ qvalue = std::max<int64_t>(-127LL, std::min<int64_t>(qvalue, 127LL));
16
qdata[i] = static_cast<int8_t>(qvalue);
17
}
18
return output;
0 commit comments