Skip to content

Fix computation of padding in case of 'auto_pad' attribute set to SAME_UPPER or SAME_LOWER

Maxence Naud requested to merge fix_pad-same-upper-same-lower into dev

Context

Update padding deduction function for auto_pad attribute if it is "SAME_UPPER" or "SAME_LOWER"

Here are the results:

auto_pad type: SAME_UPPER
kernel_dims = [1, 1], stride_dims = [1, 1]: [0, 0, 0, 0]
kernel_dims = [2, 2], stride_dims = [1, 1]: [1, 1, 0, 0]
kernel_dims = [3, 3], stride_dims = [1, 1]: [1, 1, 1, 1]
kernel_dims = [4, 4], stride_dims = [1, 1]: [2, 2, 1, 1]

auto_pad type: SAME_LOWER
kernel_dims = [1, 1], stride_dims = [1, 1]: [0, 0, 0, 0]
kernel_dims = [2, 2], stride_dims = [1, 1]: [0, 0, 1, 1]
kernel_dims = [3, 3], stride_dims = [1, 1]: [1, 1, 1, 1]
kernel_dims = [4, 4], stride_dims = [1, 1]: [1, 1, 2, 2]

auto_pad type: SAME_UPPER
kernel_dims = [2, 2], stride_dims = [2, 2]: [0, 0, 0, 0]
kernel_dims = [3, 3], stride_dims = [2, 2]: [1, 1, 0, 0]
kernel_dims = [4, 4], stride_dims = [2, 2]: [1, 1, 1, 1]

auto_pad type: SAME_LOWER
kernel_dims = [2, 2], stride_dims = [2, 2]: [0, 0, 0, 0]
kernel_dims = [3, 3], stride_dims = [2, 2]: [0, 0, 1, 1]
kernel_dims = [4, 4], stride_dims = [2, 2]: [1, 1, 1, 1]
Edited by Maxence Naud

Merge request reports

Loading