diff --git a/include/aidge/operator/MaxPooling.hpp b/include/aidge/operator/MaxPooling.hpp index d224ee0cd4b7609d7b476df083fc8cfaf9a7b34e..bcf47f13cc34132f668ea1ffcb2c91ed6f06f44d 100644 --- a/include/aidge/operator/MaxPooling.hpp +++ b/include/aidge/operator/MaxPooling.hpp @@ -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] -