Skip to content

Commit

Permalink
[PIR]Migrate unique into pir (#58194)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x45f authored Oct 18, 2023
1 parent 793da42 commit c29dca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ def unique(
else:
axis = [axis]
attr_dtype = convert_np_dtype_to_dtype_(dtype)
if in_dynamic_mode():
if in_dynamic_or_pir_mode():
out, indices, inverse, counts = _C_ops.unique(
x, return_index, return_inverse, return_counts, axis, attr_dtype
)
Expand Down
2 changes: 2 additions & 0 deletions test/legacy_test/test_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import paddle
from paddle.base import core
from paddle.pir_utils import test_with_pir_api


class TestUniqueOp(OpTest):
Expand Down Expand Up @@ -413,6 +414,7 @@ def test_dygraph_attr_dtype(self):
self.assertTrue((inverse.numpy() == np_inverse).all(), True)
self.assertTrue((counts.numpy() == np_counts).all(), True)

@test_with_pir_api
def test_static_graph(self):
with paddle_static_guard():
with paddle.static.program_guard(
Expand Down

0 comments on commit c29dca4

Please sign in to comment.