Skip to content

Commit

Permalink
[PIR]Migrate min into pir (PaddlePaddle#58110)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x45f authored and jiahy0825 committed Oct 26, 2023
1 parent 0a732df commit 04b375f
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/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -2937,7 +2937,7 @@ def min(x, axis=None, keepdim=False, name=None):
[0., 0.]]])
"""

if in_dynamic_mode():
if in_dynamic_or_pir_mode():
return _C_ops.min(x, axis, keepdim)
else:
reduce_all, axis = _get_reduce_axis_with_tensor(axis, x)
Expand Down
2 changes: 2 additions & 0 deletions test/legacy_test/test_min_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import paddle
from paddle import base
from paddle.base import core
from paddle.pir_utils import test_with_pir_api


class ApiMinTest(unittest.TestCase):
Expand All @@ -30,6 +31,7 @@ def setUp(self):
else:
self.place = core.CPUPlace()

@test_with_pir_api
def test_api(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down

0 comments on commit 04b375f

Please sign in to comment.