Skip to content

Commit

Permalink
Update test_converter_manipulation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PolaKuma committed Jan 21, 2025
1 parent 44c6555 commit 1ba7381
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/tensorrt/test_converter_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,7 @@ def test_trt_result(self):
self.check_trt_result()


def wrapper_pad_error1(x):
return paddle.nn.functional.pad(
x, pad=[0, 0, 0, 0, 0, 0, 1, 1, 0, 0], mode='constant', value=0
)


def wrapper_pad_error2(x, padding, mode, pad_value):
def wrapper_pad_error(x, padding, mode, pad_value):
return paddle.nn.functional.pad(
x=paddle.to_tensor(np.random.randn(1, 1, 1, 2, 3).astype("float32")),
pad=[0, 0, 0, 0, 0, 0, 1, 1, 0, 0],
Expand Down Expand Up @@ -697,7 +691,7 @@ def test_trt_result(self):

class TestPadError2TRTPattern(TensorRTBaseTest):
def setUp(self):
self.python_api = wrapper_pad_error2
self.python_api = wrapper_pad_error
self.api_args = {
"x": np.random.randn(1, 1, 1, 2, 3).astype("float32"),
"paddings": [1, 1, 1, 0, 0, 0, 1, 1, 0, 0],
Expand All @@ -715,7 +709,7 @@ def test_trt_result(self):

class TestPadError3TRTPattern(TensorRTBaseTest):
def setUp(self):
self.python_api = wrapper_pad_error2
self.python_api = wrapper_pad_error
self.api_args = {
"x": np.random.randn(1, 1).astype("float32"),
"paddings": [0, 0, 0, 0, 0, 0, 1, 1, 0, 0],
Expand Down

0 comments on commit 1ba7381

Please sign in to comment.