-
Notifications
You must be signed in to change notification settings - Fork 6k
【Hackathon 9th Sprint No.06】NO.06 paddle.nn.MaxPool2D兼容性增强 #76714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3a8c699
bcbeb54
1f92a46
cb487f9
f582b9f
b63d45d
d2cf355
5f77217
5096c40
ff24ce3
e15c147
32c16f6
4fbc263
1953589
9a2de36
f8e0db9
1a41726
4fe497c
98e5b17
967b3bc
d54b205
2133a77
37ea197
d694f46
8970a99
351773b
5a6f478
187670b
4dd58d8
502d99f
4ae3219
b5e0d06
a2ad576
1d818f5
254ee30
715e508
48601cd
b2bd396
22a69c6
719e8a9
0898713
b51d436
53590b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1238,56 +1238,52 @@ def max_pool2d( | |
|
|
||
| if in_dynamic_or_pir_mode(): | ||
| if return_mask: | ||
| if dilation_greater_than_one: | ||
| output = _C_ops.max_pool2d_with_dilations_and_index( | ||
| x, kernel_size, stride, padding, dilation, False, ceil_mode | ||
| ) | ||
| else: | ||
| output = _C_ops.max_pool2d_with_index( | ||
| x, kernel_size, stride, padding, False, False, ceil_mode | ||
| ) | ||
| return output if return_mask else output[0] | ||
| else: | ||
| return _C_ops.pool2d( | ||
| # if dilation_greater_than_one: | ||
| # output = _C_ops.max_pool2d_with_dilations_and_index( | ||
| # x, kernel_size, stride, padding, dilation, False, ceil_mode | ||
| # ) | ||
| # else: | ||
| # output = _C_ops.max_pool2d_with_index( | ||
| # x, kernel_size, stride, padding, False, False, ceil_mode | ||
| # ) | ||
| output = _C_ops.max_pool2d_with_index( | ||
| x, | ||
| kernel_size, | ||
| stride, | ||
| padding, | ||
| dilation, | ||
| ceil_mode, | ||
| True, | ||
| data_format, | ||
| 'max', | ||
| False, | ||
| False, | ||
| padding_algorithm, | ||
| ceil_mode, | ||
| ) | ||
| # if dilation_greater_than_one: | ||
| # return _C_ops.max_pool2d_with_dilations( | ||
| # x, | ||
| # kernel_size, | ||
| # stride, | ||
| # padding, | ||
| # dilation, | ||
| # ceil_mode, | ||
| # data_format, | ||
| # False, | ||
| # padding_algorithm, | ||
| # ) | ||
| # else: | ||
| # return _C_ops.pool2d( | ||
| # x, | ||
| # kernel_size, | ||
| # stride, | ||
| # padding, | ||
| # ceil_mode, | ||
| # True, | ||
| # data_format, | ||
| # 'max', | ||
| # False, | ||
| # False, | ||
| # padding_algorithm, | ||
| # ) | ||
| return output if return_mask else output[0] | ||
| else: | ||
| if dilation_greater_than_one: | ||
|
||
| return _C_ops.max_pool2d_with_dilations( | ||
| x, | ||
| kernel_size, | ||
| stride, | ||
| padding, | ||
| dilation, | ||
| ceil_mode, | ||
| data_format, | ||
| False, | ||
| padding_algorithm, | ||
| ) | ||
| else: | ||
| return _C_ops.pool2d( | ||
| x, | ||
| kernel_size, | ||
| stride, | ||
| padding, | ||
| ceil_mode, | ||
| True, | ||
| data_format, | ||
| 'max', | ||
| False, | ||
| False, | ||
| padding_algorithm, | ||
| ) | ||
|
|
||
| else: | ||
| if return_mask: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是说直接修改pool2d会引起很多兼容性问题对吧,所以改名为一个新op:max_pool2d_with_dilations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avg 等等其他算子也依赖 pool2d,对于它们来说,dilation是冗余的