Skip to content

[SWE-Paddle] Add task PaddlePaddle__Paddle-78238#1409

Open
Echo-Nie wants to merge 5 commits into
PaddlePaddle:masterfrom
Echo-Nie:PR78238
Open

[SWE-Paddle] Add task PaddlePaddle__Paddle-78238#1409
Echo-Nie wants to merge 5 commits into
PaddlePaddle:masterfrom
Echo-Nie:PR78238

Conversation

@Echo-Nie

@Echo-Nie Echo-Nie commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

关联

@sunzhongkai588

说明

新增 SWE-Paddle 任务 PaddlePaddle__Paddle-78238

该任务覆盖 paddle.put_along_axisTensor.put_along_axis_ 对 0-size indices Tensor 的处理。测试包含非 0-size indices regression case,以及 out-of-place 和 in-place API 的目标场景,可在 CPU 环境运行。

验证结果

状态 P2P 非原地 F2P 原地 F2P
Base + tests/test.patch PASS FAIL,符合预期 FAIL,符合预期
Base + test patch + solution/code.patch PASS PASS PASS

Base P2P

.                                                                        [100%]
1 passed in 0.30s

Base F2P:out of place接口

F                                                                        [100%]
================================== FAILURES ===================================
________ TestPutAlongAxisZeroSize.test_zero_size_indices_out_of_place _________

>       out = paddle.put_along_axis(arr, indices, values, axis=1)

E   ValueError: (InvalidArgument) The value (4) of the non-singleton
E   dimension does not match the corresponding value (0) in shape
E   for expand_v2 op.

FAILED test/legacy_test/test_put_along_axis_zero_size.py::TestPutAlongAxisZeroSize::test_zero_size_indices_out_of_place
1 failed in 1.23s

Base F2P:in place接口

F                                                                        [100%]
================================== FAILURES ===================================
__________ TestPutAlongAxisZeroSize.test_zero_size_indices_in_place ___________

>       result = arr.put_along_axis_(indices, values, axis=1)

E   ValueError: (InvalidArgument) The value (4) of the non-singleton
E   dimension does not match the corresponding value (0) in shape
E   for expand_v2 op.

FAILED test/legacy_test/test_put_along_axis_zero_size.py::TestPutAlongAxisZeroSize::test_zero_size_indices_in_place
1 failed in 0.84s

Solution P2P

.                                                                        [100%]
1 passed in 0.27s

Solution F2P:out of place接口

.                                                                        [100%]
1 passed in 0.29s

Solution F2P:in place接口

.                                                                        [100%]
1 passed in 0.27s

@paddle-bot

paddle-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

@sunzhongkai588 sunzhongkai588 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants