Skip to content
Snippets Groups Projects
Commit ac2168cc authored by Cyril Moineau's avatar Cyril Moineau
Browse files

[MaxPooling] Fix MSVC compilation issue.

parent a8c98204
No related branches found
No related tags found
1 merge request!36[MaxPooling] Add support for ceil_mode parameter.
Checking pipeline status
......@@ -96,9 +96,14 @@ public:
void computeOutputDims() override final {
if (!mInput->empty()) {
std::array<DimSize_t, DIM + 2> outputDims = {};
auto roundingFunction = (this->template getAttr<MaxPoolingAttr::CeilMode>()) ?
[](float x){return std::ceil(x);} :
[](float x){return std::floor(x);};
std::function<float(float)> roundingFunction;
if (this->template getAttr<MaxPoolingAttr::CeilMode>()) {
roundingFunction = [](float x) { return std::ceil(x); };
} else {
roundingFunction = [](float x) { return std::floor(x); };
}
for (std::size_t dim = 0; dim < this->template getAttr<MaxPoolingAttr::KernelDims>().size() ; ++dim) {
outputDims[dim+2] = 1 + static_cast<DimSize_t>(
roundingFunction(static_cast<float>(mInput->dims()[dim+2] -
......
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