Skip to content
Snippets Groups Projects
Commit 7330a819 authored by Mickael GUIBERT's avatar Mickael GUIBERT
Browse files

[Fix] Suppress constexpr and simplified the choice of rounding

parent aaf94238
No related branches found
No related tags found
No related merge requests found
......@@ -116,11 +116,9 @@ void pooling_forward(
}
}
if constexpr (std::is_integral<Output_T>::value) {
outputs[oOffset + output] = (Output_T) std::round((float)sum / (POOL_HEIGHT * POOL_WIDTH));
} else {
outputs[oOffset + output] = (Output_T) (sum / (POOL_HEIGHT * POOL_WIDTH));
}
outputs[oOffset + output] = static_cast<Output_T>(
std::is_integral<Output_T>::value ? std::round((float)sum / (POOL_HEIGHT * POOL_WIDTH)) : sum / (POOL_HEIGHT * POOL_WIDTH)
);
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment