Skip to content

更新unique函数中的sorted参数 #569

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

Merged
merged 4 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions paconvert/api_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -4270,11 +4270,9 @@
"dim"
],
"kwargs_change": {
"sorted": "",
"dim": "axis"
},
"unsupport_args": [
"sorted"
]
}
},
"torch.Tensor.unique_consecutive": {
"Matcher": "GenericMatcher",
Expand Down Expand Up @@ -17740,11 +17738,9 @@
],
"kwargs_change": {
"input": "x",
"sorted": "",
"dim": "axis"
},
"unsupport_args": [
"sorted"
]
}
},
"torch.unique_consecutive": {
"Matcher": "GenericMatcher",
Expand Down
12 changes: 3 additions & 9 deletions tests/test_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def test_case_4():
result = torch.unique(input=a, sorted=False, return_inverse=True, return_counts=False, dim=dim)
"""
)
obj.run(
pytorch_code, ["result"], unsupport=True, reason="Paddle not support 'sorted' "
)
obj.run(pytorch_code, ["result"])


def test_case_5():
Expand All @@ -94,9 +92,7 @@ def test_case_6():
result = torch.unique(a, False, True, False, dim)
"""
)
obj.run(
pytorch_code, ["result"], unsupport=True, reason="Paddle not support 'sorted' "
)
obj.run(pytorch_code, ["result"])


def test_case_7():
Expand All @@ -109,6 +105,4 @@ def test_case_7():
result = torch.unique(return_inverse=True, input=a, return_counts=False, dim=dim, sorted=False)
"""
)
obj.run(
pytorch_code, ["result"], unsupport=True, reason="Paddle not support 'sorted' "
)
obj.run(pytorch_code, ["result"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

sorted=True的情况下做了测试没?要反复交叉测试结果是否完全一致