Skip to content

Commit

Permalink
【PIR API adaptor No.24-26】Migrate paddle.bitwise_not/bitwise_or/bitwi…
Browse files Browse the repository at this point in the history
…se_xor into pir (#58331)
  • Loading branch information
enkilee authored Oct 26, 2023
1 parent 11614e6 commit e99885f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit e99885f

Please sign in to comment.