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]Open uts for selu #60702

Merged
merged 2 commits 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
10 changes: 6 additions & 4 deletions test/legacy_test/test_selu_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def test_base_api(self):
out_ref = ref_selu(self.x_np, self.scale, self.alpha)
np.testing.assert_allclose(out_ref, res[0], rtol=1e-05)

@test_with_pir_api
def test_errors(self):
with paddle.static.program_guard(paddle.static.Program()):
# The input type must be Variable.
Expand All @@ -175,10 +176,11 @@ def test_errors(self):
# The alpha must be no less than 0
self.assertRaises(ValueError, F.selu, x_fp32, 1.6, -1.0)
# support the input dtype is float16
x_fp16 = paddle.static.data(
name='x_fp16', shape=[12, 10], dtype='float16'
)
F.selu(x_fp16)
if paddle.is_compiled_with_cuda():
x_fp16 = paddle.static.data(
name='x_fp16', shape=[12, 10], dtype='float16'
)
F.selu(x_fp16)


if __name__ == "__main__":
Expand Down