Skip to content

Commit

Permalink
#4547: Added unit tests for 2x2 window with 0 pad in maxpool
Browse files Browse the repository at this point in the history
  • Loading branch information
mywoodstock committed Jan 20, 2024
1 parent a974de4 commit cbb9bc3
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ def volume(shape):
)
@pytest.mark.parametrize(
"kernel_size",
((3, 3),),
(
(2, 2),
(3, 3),
),
)
@pytest.mark.parametrize(
"padding",
((1, 1),),
(
(0, 0),
(1, 1),
),
)
@pytest.mark.parametrize(
"stride",
Expand Down Expand Up @@ -91,6 +97,9 @@ def test_run_max_pool(
logger.info("Invalid case")
pytest.skip()

if (kernel_h == 3 and pad_h != 1) or (kernel_h == 2 and pad_h != 0):
pytest.skip(f"Unsupported case with kernel_h: {kernel_h}, pad_h: {pad_h}")

out_h = math.floor((in_h + 2 * pad_h - (dilation_h * kernel_h - 1) - 1) / stride_h) + 1
out_w = math.floor((in_w + 2 * pad_w - (dilation_w * kernel_w - 1) - 1) / stride_w) + 1
if out_w % nblocks != 0:
Expand Down

0 comments on commit cbb9bc3

Please sign in to comment.