Skip to content

Commit

Permalink
[PIR]Migrate ceil into pir (PaddlePaddle#57947)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x45f authored Oct 10, 2023
1 parent 1d1bae2 commit 712cfc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/paddle/tensor/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def ceil(x, name=None):
Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
[-0., -0., 1. , 1. ])
"""
if in_dynamic_mode():
if in_dynamic_or_pir_mode():
return _C_ops.ceil(x)
else:
check_variable_and_dtype(
Expand Down
7 changes: 5 additions & 2 deletions test/legacy_test/test_activation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,9 @@ def setUp(self):
def init_shape(self):
self.shape = [10, 12]

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

# The same reason with TestFloor
def test_check_grad(self):
pass
Expand Down Expand Up @@ -4575,7 +4578,7 @@ def test_check_grad(self):
create_test_act_fp16_class(
TestAbs, check_prim=True, enable_cinn=True, check_new_ir=True
)
create_test_act_fp16_class(TestCeil, grad_check=False)
create_test_act_fp16_class(TestCeil, grad_check=False, check_new_ir=True)
create_test_act_fp16_class(
TestFloor, check_prim=True, grad_check=False, enable_cinn=True
)
Expand Down Expand Up @@ -4721,7 +4724,7 @@ def test_check_grad(self):
create_test_act_bf16_class(TestSqrt, check_prim=True, check_new_ir=True)
create_test_act_bf16_class(TestSqrtComp, check_prim=True, check_new_ir=True)
create_test_act_bf16_class(TestAbs, check_prim=True, check_new_ir=True)
create_test_act_bf16_class(TestCeil, grad_check=False)
create_test_act_bf16_class(TestCeil, grad_check=False, check_new_ir=True)
create_test_act_bf16_class(TestFloor, grad_check=False, check_prim=True)
create_test_act_bf16_class(TestCos)
create_test_act_bf16_class(TestTan)
Expand Down

0 comments on commit 712cfc7

Please sign in to comment.