Skip to content

Commit

Permalink
[PIR]Open uts for sinh (#60714)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x45f authored Jan 11, 2024
1 parent 78eec98 commit f555263
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/legacy_test/test_activation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,10 @@ def test_backward(self):


class TestSinhOpError(unittest.TestCase):
@test_with_pir_api
def test_errors(self):
with static_guard():
with program_guard(Program()):
with paddle.static.program_guard(paddle.static.Program()):
# The input type must be Variable.
self.assertRaises(TypeError, paddle.sinh, 1)
# The input dtype must be float16, float32, float64.
Expand All @@ -1026,10 +1027,11 @@ def test_errors(self):
)
self.assertRaises(TypeError, paddle.sinh, x_int32)
# support the input dtype is float16
x_fp16 = paddle.static.data(
name='x_fp16', shape=[12, 10], dtype='float16'
)
paddle.sinh(x_fp16)
if paddle.is_compiled_with_cuda():
x_fp16 = paddle.static.data(
name='x_fp16', shape=[12, 10], dtype='float16'
)
paddle.sinh(x_fp16)


class TestCosh(TestActivation):
Expand Down Expand Up @@ -4893,7 +4895,7 @@ def test_check_grad(self):
create_test_act_fp16_class(TestCosh, check_pir=True)
create_test_act_fp16_class(TestAcos, check_pir=True)
create_test_act_fp16_class(TestSin, check_pir=True, check_prim_pir=True)
create_test_act_fp16_class(TestSinh)
create_test_act_fp16_class(TestSinh, check_pir=True)
create_test_act_fp16_class(TestAsin, check_pir=True)
create_test_act_fp16_class(TestAtan, check_pir=True)
create_test_act_fp16_class(TestAcosh, check_pir=True)
Expand Down Expand Up @@ -5068,7 +5070,7 @@ def test_check_grad(self):
create_test_act_bf16_class(TestCosh, check_pir=True)
create_test_act_bf16_class(TestAcos, check_pir=True)
create_test_act_bf16_class(TestSin, check_pir=True, check_prim_pir=True)
create_test_act_bf16_class(TestSinh)
create_test_act_bf16_class(TestSinh, check_pir=True)
create_test_act_bf16_class(TestAsin, check_pir=True)
create_test_act_bf16_class(TestAtan, check_pir=True)
create_test_act_bf16_class(TestAcosh, check_pir=True)
Expand Down

0 comments on commit f555263

Please sign in to comment.