Skip to content
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

[PIR]Migrate all into pir #57761

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -4748,7 +4748,7 @@ def all(x, axis=None, keepdim=False, name=None):
[True ]])

"""
if in_dynamic_mode():
if in_dynamic_or_pir_mode():
return _C_ops.all(x, axis, keepdim)
else:
reduce_all, axis = _get_reduce_axis(axis, x)
Expand Down
18 changes: 9 additions & 9 deletions test/legacy_test/test_reduce_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def setUp(self):
self.attrs = {'reduce_all': True}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllFloatOp(OpTest):
Expand All @@ -834,7 +834,7 @@ def setUp(self):
self.attrs = {'reduce_all': True}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllIntOp(OpTest):
Expand All @@ -846,7 +846,7 @@ def setUp(self):
self.attrs = {'reduce_all': True}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllOp_ZeroDim(OpTest):
Expand All @@ -858,7 +858,7 @@ def setUp(self):
self.attrs = {'dim': []}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAll8DOp(OpTest):
Expand All @@ -874,7 +874,7 @@ def setUp(self):
self.outputs = {'Out': self.inputs['X'].all(axis=self.attrs['dim'])}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllOpWithDim(OpTest):
Expand All @@ -886,7 +886,7 @@ def setUp(self):
self.outputs = {'Out': self.inputs['X'].all(axis=self.attrs['dim'])}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAll8DOpWithDim(OpTest):
Expand All @@ -902,7 +902,7 @@ def setUp(self):
self.outputs = {'Out': self.inputs['X'].all(axis=self.attrs['dim'])}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllOpWithKeepDim(OpTest):
Expand All @@ -916,7 +916,7 @@ def setUp(self):
}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAll8DOpWithKeepDim(OpTest):
Expand All @@ -936,7 +936,7 @@ def setUp(self):
}

def test_check_output(self):
self.check_output()
self.check_output(check_new_ir=True)


class TestAllOpError(unittest.TestCase):
Expand Down