From ac2168cca39dbdbb81d385c1e19db3cd42b9654f Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Fri, 20 Oct 2023 13:06:05 +0000 Subject: [PATCH] [MaxPooling] Fix MSVC compilation issue. --- include/aidge/operator/MaxPooling.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/aidge/operator/MaxPooling.hpp b/include/aidge/operator/MaxPooling.hpp index d224ee0cd..bcf47f13c 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] - -- GitLab