Skip to content

Conversation

liqunfu
Copy link
Contributor

@liqunfu liqunfu commented Apr 20, 2023

Description

Motivation and Context

AveragePoolXDTask can be refactored with LpPoolXDTask. However, there has been an issue with LpPool in ONNX (#6302). with the issue fixed, LpPoolXDTask can be implemented using AveragePoolXDTask. This is not in the scope of this PR.

Signed-off-by: Liqun Fu <[email protected]>
xadupre
xadupre previously approved these changes Apr 20, 2023
Signed-off-by: Liqun Fu <[email protected]>
@gramalingam
Copy link
Contributor

Nit: update the title and description to indicate that this PR also covers "Pad-19" ?

if (mode == Mode::Reflect) {
PadInnermostAxis(axisStart - prePad, axisStart + prePad, -1 /* inputDelta */, onnxruntime::narrow<size_t>(prePad));
PadInnermostAxis(output, output - 2, -1 /* inputDelta */, onnxruntime::narrow<size_t>(postPad));
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: a comment like // mode == Mode::Wrap would be helpful in the else-line (here and similarly below).

gramalingam
gramalingam previously approved these changes Apr 24, 2023
@liqunfu liqunfu changed the title support AveragePool19 support AveragePool19 and Pad19 Apr 24, 2023
@liqunfu liqunfu added this to the release 1.15 milestone Apr 28, 2023
@liqunfu
Copy link
Contributor Author

liqunfu commented May 10, 2023

Pad19: #15576
AveragePool19: #15569

Signed-off-by: Liqun Fu <[email protected]>
@liqunfu liqunfu merged commit a8d9b29 into main May 15, 2023
@liqunfu liqunfu deleted the liqun/averagepool19 branch May 15, 2023 17:46
prathikr pushed a commit that referenced this pull request May 16, 2023
@snnn snnn removed the release:1.15 label May 18, 2023
titaiwangms added a commit that referenced this pull request Jan 24, 2025
Fix #16203

Previous to this PR, if `ceil_mode` is on, the calculation of a value
would divide the kernel size, even if remaining pixels is less than the
kernel size, which causes the difference in this operator between ORT
and torch.

However, this fix only applies to the change in #15597, which only
supports AvgPool since 19. The older opset version is remain the same,
as it's using mlas files.

Also, the PR fixes the shape mismatch caused by sliding window starting
from padding. More detail: onnx/onnx#6650 (And
this PR is also validated with the tests added in
onnx/onnx#6650)
ashrit-ms pushed a commit that referenced this pull request Feb 11, 2025
Fix #16203

Previous to this PR, if `ceil_mode` is on, the calculation of a value
would divide the kernel size, even if remaining pixels is less than the
kernel size, which causes the difference in this operator between ORT
and torch.

However, this fix only applies to the change in #15597, which only
supports AvgPool since 19. The older opset version is remain the same,
as it's using mlas files.

Also, the PR fixes the shape mismatch caused by sliding window starting
from padding. More detail: onnx/onnx#6650 (And
this PR is also validated with the tests added in
onnx/onnx#6650)
guschmue pushed a commit that referenced this pull request Mar 6, 2025
Fix #16203

Previous to this PR, if `ceil_mode` is on, the calculation of a value
would divide the kernel size, even if remaining pixels is less than the
kernel size, which causes the difference in this operator between ORT
and torch.

However, this fix only applies to the change in #15597, which only
supports AvgPool since 19. The older opset version is remain the same,
as it's using mlas files.

Also, the PR fixes the shape mismatch caused by sliding window starting
from padding. More detail: onnx/onnx#6650 (And
this PR is also validated with the tests added in
onnx/onnx#6650)
ashrit-ms pushed a commit that referenced this pull request Mar 17, 2025
Fix #16203

Previous to this PR, if `ceil_mode` is on, the calculation of a value
would divide the kernel size, even if remaining pixels is less than the
kernel size, which causes the difference in this operator between ORT
and torch.

However, this fix only applies to the change in #15597, which only
supports AvgPool since 19. The older opset version is remain the same,
as it's using mlas files.

Also, the PR fixes the shape mismatch caused by sliding window starting
from padding. More detail: onnx/onnx#6650 (And
this PR is also validated with the tests added in
onnx/onnx#6650)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants