From 0d7ca6f00dc2aee4a4c13e208616183fad636cb5 Mon Sep 17 00:00:00 2001 From: Hoonkyung Cho Date: Fri, 16 Aug 2024 09:18:52 +0900 Subject: [PATCH] fix: Adjust reflection pad test cases to prevent runtime errors (#3088) --- py/torch_tensorrt/dynamo/conversion/impl/pad.py | 2 +- tests/py/dynamo/conversion/test_pad_aten.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py/torch_tensorrt/dynamo/conversion/impl/pad.py b/py/torch_tensorrt/dynamo/conversion/impl/pad.py index f2f3e11f00..66cc09684b 100644 --- a/py/torch_tensorrt/dynamo/conversion/impl/pad.py +++ b/py/torch_tensorrt/dynamo/conversion/impl/pad.py @@ -79,7 +79,7 @@ def get_padded_shape_tensors( ).get_output(0) ) padded_shape_tensor = impl.cat.cat( - ctx, target, source_ir, f"{name}_cat", slices, 0 + ctx, target, source_ir, f"{name}_cat_dim_{i}", slices, 0 ) start_indices_tensor = get_trt_tensor( diff --git a/tests/py/dynamo/conversion/test_pad_aten.py b/tests/py/dynamo/conversion/test_pad_aten.py index b200e6116e..1a29690be8 100644 --- a/tests/py/dynamo/conversion/test_pad_aten.py +++ b/tests/py/dynamo/conversion/test_pad_aten.py @@ -146,9 +146,9 @@ def forward(self, input): [ ( "4d", - (1, 1, 1, 1), (2, 2, 2, 2), - (3, 3, 3, 3), + (4, 4, 4, 4), + (6, 6, 6, 6), torch.float, (1, 1, 2, 2), ), @@ -199,9 +199,9 @@ def forward(self, input): [ ( "5d", - (1, 1, 1, 1, 1), (2, 2, 2, 2, 2), - (3, 3, 3, 3, 3), + (4, 4, 4, 4, 4), + (6, 6, 6, 6, 6), torch.float, (1, 2, 2, 1, 1, 2), ),