From 7aced9915f7d749c17c4f77d01e73e08e6afaa62 Mon Sep 17 00:00:00 2001 From: "maruiyan.mry" Date: Sat, 7 May 2022 23:38:31 -0700 Subject: [PATCH] [ODLA/TRT] fix:dilation for conv/deconv (cherry picked from commit 47cbb8c52b9bc01052521304140e2749e6b4b748) --- ODLA/platforms/tensorrt/odla_tensorrt.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ODLA/platforms/tensorrt/odla_tensorrt.cc b/ODLA/platforms/tensorrt/odla_tensorrt.cc index d96e87ac6..8e2ad6f73 100644 --- a/ODLA/platforms/tensorrt/odla_tensorrt.cc +++ b/ODLA/platforms/tensorrt/odla_tensorrt.cc @@ -1869,6 +1869,7 @@ odla_value odla_Conv(odla_value input, odla_memory_layout input_layout, static_cast(kernel_dims.dims[3])}, kernel_weights, bias_weights); conv->setStride(nvinfer1::DimsHW(strides[0], strides[1])); + conv->setDilation(nvinfer1::DimsHW(dilations[0], dilations[1])); #else auto conv = g_comp->network->addConvolutionNd( *input, oc, @@ -1876,6 +1877,7 @@ odla_value odla_Conv(odla_value input, odla_memory_layout input_layout, static_cast(kernel_dims.dims[3])}, kernel_weights, bias_weights); conv->setStrideNd(nvinfer1::DimsHW(strides[0], strides[1])); + conv->setDilationNd(nvinfer1::DimsHW(dilations[0], dilations[1])); #endif conv->setPrePadding(nvinfer1::DimsHW(paddings_front[0], paddings_front[1])); conv->setPostPadding(nvinfer1::DimsHW(paddings_back[0], paddings_back[1])); @@ -1916,6 +1918,7 @@ odla_value odla_DeConv(odla_value input, odla_memory_layout input_layout, static_cast(kernel_dims.dims[3])}, kernel_weights, bias_weights); conv->setStride(nvinfer1::DimsHW(strides[0], strides[1])); + conv->setDilation(nvinfer1::DimsHW(dilations[0], dilations[1])); #else auto conv = g_comp->network->addDeconvolutionNd( *input, oc, @@ -1923,6 +1926,7 @@ odla_value odla_DeConv(odla_value input, odla_memory_layout input_layout, static_cast(kernel_dims.dims[3])}, kernel_weights, bias_weights); conv->setStrideNd(nvinfer1::DimsHW(strides[0], strides[1])); + conv->setDilationNd(nvinfer1::DimsHW(dilations[0], dilations[1])); #endif conv->setPrePadding(nvinfer1::DimsHW(paddings_front[0], paddings_front[1]));