We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12d17ef commit 7c832e3Copy full SHA for 7c832e3
backends/cadence/vision/kernels/kernels.cpp
@@ -25,8 +25,8 @@ void* allocate_temp_memory(KernelRuntimeContext& ctx, size_t size) {
25
// Quantize a fp32 value to an int8_t/uint8_t value
26
template <typename T>
27
T quantize(const float x, float scale, int32_t zero_point) {
28
- constexpr float min_val = std::numeric_limits<T>::min();
29
- constexpr float max_val = std::numeric_limits<T>::max();
+ constexpr float min_val = static_cast<float>(std::numeric_limits<T>::min());
+ constexpr float max_val = static_cast<float>(std::numeric_limits<T>::max());
30
float tmp = roundf(x * scale + zero_point);
31
return std::max(std::min(tmp, max_val), min_val);
32
}
0 commit comments