diff --git a/mobile/src/operators/kernel/cl/pool_kernel.cpp b/mobile/src/operators/kernel/cl/pool_kernel.cpp index ed0731c31b01728592336abcd1e282fc74f5ca11..990f6ea67572043b4d09332ab0a1c82cdb8765f9 100644 --- a/mobile/src/operators/kernel/cl/pool_kernel.cpp +++ b/mobile/src/operators/kernel/cl/pool_kernel.cpp @@ -50,6 +50,14 @@ void PoolKernel::Compute(const PoolParam ¶m) { std::vector ksize = param.Ksize(); std::vector strides = param.Strides(); std::vector paddings = param.Paddings(); + + if (param.isGlobalPooling()) { + for (size_t i = 0; i < ksize.size(); ++i) { + paddings[i] = 0; + ksize[i] = static_cast(param.Input()->dims()[i + 2]); + } + } + const int pad_top = paddings[0]; const int pad_left = paddings[1]; const int stride_h = strides[0];