Skip to content
Snippets Groups Projects
Commit 2e3f8e74 authored by ziheng's avatar ziheng Committed by Tianqi Chen
Browse files

[TOPI] Fix for pooling (#673)

parent b55361b4
No related branches found
No related tags found
No related merge requests found
......@@ -81,14 +81,14 @@ def pool(data, kernel, stride, padding, pool_type, ceil_mode=False):
pad_top, pad_left, pad_down, pad_right = get_pad_tuple(
padding, (kernel_height, kernel_width))
pad_before = [0, 0, pad_top, pad_left]
pad_after = [0, 0, pad_down, pad_right]
if ceil_mode:
# Additional padding to ensure we do ceil instead of floor when divide stride.
pad_down += stride_height -1
pad_right += stride_width - 1
pad_before = [0, 0, pad_top, pad_left]
pad_after = [0, 0, pad_down, pad_right]
out_height = util.simplify((height - kernel_height + pad_top + pad_down) // stride_height + 1)
out_width = util.simplify((width - kernel_width + pad_left + pad_right) // stride_width + 1)
......
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