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

[fixbugs] adjusting the precision of TestRelu #70972

Merged
merged 1 commit into from
Feb 8, 2025
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
19 changes: 3 additions & 16 deletions test/tensorrt/test_converter_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import paddle


class TestEluTRTPatternCase1(TensorRTBaseTest):
class TestEluTRTPattern(TensorRTBaseTest):
def setUp(self):
self.python_api = paddle.nn.functional.elu
self.api_args = {
Expand All @@ -35,21 +35,8 @@ def setUp(self):
def test_trt_result(self):
self.check_trt_result()


class TestEluTRTPatternCase2(TensorRTBaseTest):
def setUp(self):
self.python_api = paddle.nn.functional.elu
self.api_args = {
"x": np.random.randn(3).astype("float16"),
"alpha": 1.0,
}
self.program_config = {"feed_list": ["x"]}
self.min_shape = {"x": [1]}
self.opt_shape = {"x": [1]}
self.max_shape = {"x": [5]}

def test_trt_result(self):
self.check_trt_result()
def test_trt_result_fp16(self):
self.check_trt_result(rtol=1e-3, atol=1e-3, precision_mode="fp16")


class TestHardSigmoidTRTPattern(TensorRTBaseTest):
Expand Down
Loading