diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index c21d18d845562..244e7d31bf758 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -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) diff --git a/test/legacy_test/test_min_op.py b/test/legacy_test/test_min_op.py index e24471b20dca8..78601c77ecf06 100644 --- a/test/legacy_test/test_min_op.py +++ b/test/legacy_test/test_min_op.py @@ -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): @@ -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(