Skip to content

[PIR]Open uts for sinh #60714

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

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
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 @@ -4890,7 +4892,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 @@ -5065,7 +5067,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