Skip to content

[SWE-Paddle] Add task PaddlePaddle__Paddle-74305 - #1460

Open
co63oc wants to merge 3 commits into
PaddlePaddle:masterfrom
co63oc:pr74305
Open

[SWE-Paddle] Add task PaddlePaddle__Paddle-74305#1460
co63oc wants to merge 3 commits into
PaddlePaddle:masterfrom
co63oc:pr74305

Conversation

@co63oc

@co63oc co63oc commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

关联

@sunzhongkai588

说明

新增 SWE-Paddle 任务 PaddlePaddle__Paddle-74305

该任务覆盖 paddle.unique 对 0-size Tensor 的处理。测试包含非 0-size Tensor regression case,以及 unique 的目标场景,可在 CPU 环境运行。

paddle.unique_consecutive应用补丁前已支持0-size,修改是优化代码,不加入当前任务

验证结果

状态 P2P unique F2P
Base + tests/test.patch PASS FAIL
Base + test patch + solution/code.patch PASS PASS

Base P2P

========================================================= 1 passed, 1 warning in 1.31s =========================================================

Base F2P:unique

        paddle.disable_static()
        x_data = np.random.randint(0, 10, (0, 2))
        x = paddle.to_tensor(x_data)
        out = paddle.unique(x)
        expected_out = np.random.random([0, 2])
>       np.testing.assert_allclose(out.numpy(), expected_out)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-07, atol=0
E       
E       (shapes (0,), (0, 2) mismatch)
E        ACTUAL: array([], dtype=int64)
E        DESIRED: array([], shape=(0, 2), dtype=float64)

test/legacy_test/test_unique.py:491: AssertionError

Solution P2P

========================================================= 1 passed, 1 warning in 1.29s =========================================================

Solution F2P:unique

===================================================== 1 passed in 2.32s ======================================================

@co63oc
co63oc force-pushed the pr74305 branch 2 times, most recently from 229b6c8 to 9d7c90c Compare July 29, 2026 03:09
@co63oc
co63oc marked this pull request as ready for review July 29, 2026 03:14
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.

1 participant