Fixes for public issue #265
This commit is contained in:
@@ -186,11 +186,14 @@ public:
|
||||
intermediate = mul_add_accumulator(alpha_, converted_accumulator, intermediate); // D = alpha * Accum + X
|
||||
|
||||
/// Clamping constant value
|
||||
ElementCompute const kClamp =
|
||||
ElementCompute((1U << (sizeof_bits<ElementOutput>::value - 1)) - 1);
|
||||
ElementCompute const kClampMax =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::max());
|
||||
|
||||
intermediate = max_accumulator(intermediate, -kClamp - ElementCompute(1));
|
||||
intermediate = min_accumulator(intermediate, kClamp);
|
||||
ElementCompute const kClampMin =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::lowest());
|
||||
|
||||
intermediate = max_accumulator(intermediate, kClampMin);
|
||||
intermediate = min_accumulator(intermediate, kClampMax);
|
||||
|
||||
// Convert to destination numeric type
|
||||
NumericArrayConverter<ElementOutput, ElementCompute, kCount, Round> destination_converter;
|
||||
|
||||
Reference in New Issue
Block a user