在Upsample和interpolate函数中加入recompute_scale_factor参数#71997
Merged
Conversation
modified: python/paddle/nn/functional/common.py modified: python/paddle/nn/layer/common.py new file: test/legacy_test/test_interp_recompute_scale_factor.py
modified: test/legacy_test/test_interp_recompute_scale_factor.py
|
你的PR提交成功,感谢你对开源项目的贡献! |
modified: python/paddle/nn/functional/common.py modified: python/paddle/nn/layer/common.py
Contributor
Author
modified: test/legacy_test/CMakeLists.txt
zhwesky2010
reviewed
Apr 1, 2025
Contributor
zhwesky2010
left a comment
There was a problem hiding this comment.
paconvert也加下测试,在paconvert/tests目录,这个会和pytorch的运行结果作对比
|
|
||
| if ( | ||
| recompute_scale_factor is not None | ||
| and recompute_scale_factor |
modified: test/legacy_test/test_interp_recompute_scale_factor.py
modified: python/paddle/nn/functional/common.py
Contributor
Author
zhwesky2010
reviewed
Apr 3, 2025
| "align_corners option can only be set with the interpolating modes: linear | bilinear | bicubic | trilinear" | ||
| ) | ||
|
|
||
| if recompute_scale_factor and size is not None: |
Contributor
There was a problem hiding this comment.
这个放到下面的
if out_shape is not None:
分支下吧
| attrs['out_w'] = out_shape[2] | ||
|
|
||
| else: | ||
| elif scale is not None and recompute_scale_factor is not True: |
Contributor
There was a problem hiding this comment.
分支逻辑梳理一下,是否是:
if out_shape is not None:
pass
elif scale is not None:
if recompute_scale_factor:
pass
else:
pass
else:
raise error
modified: python/paddle/nn/functional/common.py
zhwesky2010
reviewed
Apr 3, 2025
|
|
||
| out_shape = size | ||
| scale = scale_factor | ||
| if out_shape is not None and scale is not None: |
| "align_corners option can only be set with the interpolating modes: linear | bilinear | bicubic | trilinear" | ||
| ) | ||
|
|
||
| if recompute_scale_factor and size is not None: |
modified: python/paddle/nn/functional/common.py
zhwesky2010
reviewed
Apr 11, 2025
| set_tests_properties(test_lstm_cudnn_op PROPERTIES TIMEOUT 120) | ||
| set_tests_properties(test_stack_op PROPERTIES TIMEOUT 120) | ||
| set_tests_properties(test_bilinear_interp_v2_op PROPERTIES TIMEOUT 120) | ||
| set_tests_properties(test_interp_recompute_scale_factor PROPERTIES TIMEOUT 120) |
Contributor
There was a problem hiding this comment.
这个耗时比较长,有办法精简下case缩短下时间不?
modified: test/legacy_test/CMakeLists.txt modified: test/legacy_test/test_interp_recompute_scale_factor.py
12 tasks
sunzhongkai588
approved these changes
Apr 14, 2025
Contributor
Author
您好,中文文档应该已经修改了 |
|
Sorry to inform you that 44860c7's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
Contributor
|
请merge下develop,重新跑下CI |
XieYunshen
approved these changes
Apr 22, 2025
YqGe585
pushed a commit
to YqGe585/Paddle
that referenced
this pull request
May 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
User Experience
PR Types
Improvements
Description
Upsample参数实际调用了interpolate参数。
参考Pytorch,recompute_scale_factor为True时计算output size,然后重置scale参数。
API文档修改:PaddlePaddle/docs#7205
PaConvert修改:PaddlePaddle/PaConvert#567