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 API adaptor No.24-26】Migrate paddle.bitwise_not/bitwise_or/bitwise_xor into pir #58331

Merged
merged 2 commits into from
Oct 26, 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
6 changes: 3 additions & 3 deletions python/paddle/tensor/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ def bitwise_or(x, y, out=None, name=None):
Tensor(shape=[3], dtype=int64, place=Place(cpu), stop_gradient=True,
[-1, -1, -3])
"""
if in_dynamic_mode() and out is None:
if in_dynamic_or_pir_mode() and out is None:
return _C_ops.bitwise_or(x, y)

return _bitwise_op(
Expand Down Expand Up @@ -1272,7 +1272,7 @@ def bitwise_xor(x, y, out=None, name=None):
Tensor(shape=[3], dtype=int64, place=Place(cpu), stop_gradient=True,
[-1, -3, -4])
"""
if in_dynamic_mode() and out is None:
if in_dynamic_or_pir_mode() and out is None:
return _C_ops.bitwise_xor(x, y)
return _bitwise_op(
op_name="bitwise_xor", x=x, y=y, name=name, out=out, binary_op=True
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def bitwise_not(x, out=None, name=None):
Tensor(shape=[3], dtype=int64, place=Place(cpu), stop_gradient=True,
[ 4, 0, -2])
"""
if in_dynamic_mode() and out is None:
if in_dynamic_or_pir_mode() and out is None:
return _C_ops.bitwise_not(x)

return _bitwise_op(
Expand Down
6 changes: 3 additions & 3 deletions test/legacy_test/test_bitwise_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def setUp(self):
self.outputs = {'Out': out}

def test_check_output(self):
self.check_output(check_cinn=True)
self.check_output(check_cinn=True, check_pir=True)

def test_check_grad(self):
pass
Expand Down Expand Up @@ -258,7 +258,7 @@ def setUp(self):
self.outputs = {'Out': out}

def test_check_output(self):
self.check_output(check_cinn=True)
self.check_output(check_cinn=True, check_pir=True)

def test_check_grad(self):
pass
Expand Down Expand Up @@ -363,7 +363,7 @@ def setUp(self):
self.outputs = {'Out': out}

def test_check_output(self):
self.check_output(check_cinn=True)
self.check_output(check_cinn=True, check_pir=True)

def test_check_grad(self):
pass
Expand Down