piotrwolinski-intel commented on a change in pull request #20855:
URL: https://github.com/apache/incubator-mxnet/pull/20855#discussion_r827038584
##########
File path: src/operator/contrib/adaptive_avg_pooling.cc
##########
@@ -219,10 +221,10 @@ bool SupportMKLDNNAveragePooling(const NDArray &in_data,
const int OH = out_data.shape()[2];
const int OW = out_data.shape()[3];
- const int strides_H = floor((IH << 1) / OH) - floor(IH / OH);
- const int strides_W = floor((IW << 1) / OW) - floor(IW / OW);
- const int kernel_H = ceil((IH << 1) / OH) - floor(IH / OH);
- const int kernel_W = ceil((IW << 1) / OW) - floor(IW / OW);
+ const int strides_H = ((IH << 1) / OH) - (IH / OH);
+ const int strides_W = ((IW << 1) / OW) - (IW / OW);
+ const int kernel_H = DIV_ROUND_UP((IH << 1) / OH, 1) - (IH / OH);
+ const int kernel_W = DIV_ROUND_UP((IW << 1) / OW, 1) - (IW / OW);
const int pad_l_top = (strides_H * (OH - 1) + kernel_H - IH) / 2;
const int pad_l_left = (strides_W * (OW - 1) + kernel_W - IW) / 2;
Review comment:
Separated them into functions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]