From c1c8dcada3d01e8c2efdf3f7d19b132ff3fb39e6 Mon Sep 17 00:00:00 2001 From: Dahan Gong Date: Mon, 28 Feb 2022 02:49:01 -0600 Subject: [PATCH] fix(tim-vx): correct wrong orders of w/h parameters (#1290) --- source/device/tim-vx/op/timvx_convolution.cc | 10 +++++----- source/device/tim-vx/op/timvx_deconv.cc | 10 +++++----- source/device/tim-vx/op/timvx_pooling.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/device/tim-vx/op/timvx_convolution.cc b/source/device/tim-vx/op/timvx_convolution.cc index 7732c40b..e38cf1f5 100644 --- a/source/device/tim-vx/op/timvx_convolution.cc +++ b/source/device/tim-vx/op/timvx_convolution.cc @@ -80,9 +80,9 @@ bool VXEngine::AddConvolutionNode(struct node* ir_node) { auto conv = this->graph->CreateOperation( weight_tensor->dims[0], tim::vx::PadType::AUTO, - std::array({ (unsigned int)param->kernel_h, (unsigned int)param->kernel_w }), - std::array({ (unsigned int)param->stride_h, (unsigned int)param->stride_w }), - std::array({ (unsigned int)param->dilation_h, (unsigned int)param->dilation_w }), + std::array({ (unsigned int)param->kernel_w, (unsigned int)param->kernel_h }), + std::array({ (unsigned int)param->stride_w, (unsigned int)param->stride_h }), + std::array({ (unsigned int)param->dilation_w, (unsigned int)param->dilation_h }), std::array({ (unsigned int)param->pad_w0, (unsigned int)param->pad_w1, (unsigned int)param->pad_h0, (unsigned int)param->pad_h1 }), multiplier); @@ -151,8 +151,8 @@ bool VXEngine::AddConvolutionNode(struct node* ir_node) auto conv = this->graph->CreateOperation( std::array({ (unsigned int)param->pad_w0, (unsigned int)param->pad_w1, (unsigned int)param->pad_h0, (unsigned int)param->pad_h1 }), - std::array({ (unsigned int)param->stride_h, (unsigned int)param->stride_w }), - std::array({ (unsigned int)param->dilation_h, (unsigned int)param->dilation_w }), + std::array({ (unsigned int)param->stride_w, (unsigned int)param->stride_h }), + std::array({ (unsigned int)param->dilation_w, (unsigned int)param->dilation_h }), param->group); if (param->activation >= 0) { diff --git a/source/device/tim-vx/op/timvx_deconv.cc b/source/device/tim-vx/op/timvx_deconv.cc index f20c5da0..a54af045 100644 --- a/source/device/tim-vx/op/timvx_deconv.cc +++ b/source/device/tim-vx/op/timvx_deconv.cc @@ -74,11 +74,11 @@ bool VXEngine::AddDeconvNode(struct node* ir_node) auto deconv = this->graph->CreateOperation( weight_tensor->dims[0], tim::vx::PadType::AUTO, - std::array({ (unsigned int)param->kernel_h, (unsigned int)param->kernel_w }), - std::array({ (unsigned int)param->stride_h, (unsigned int)param->stride_w }), - std::array({ (unsigned int)param->output_pad_h0, (unsigned int)param->output_pad_w0 }), - std::array({ (unsigned int)param->pad_h0, (unsigned int)param->pad_h1, - (unsigned int)param->pad_w0, (unsigned int)param->pad_w1 }), + std::array({ (unsigned int)param->kernel_w, (unsigned int)param->kernel_h }), + std::array({ (unsigned int)param->stride_w, (unsigned int)param->stride_h }), + std::array({ (unsigned int)param->output_pad_w0, (unsigned int)param->output_pad_h0 }), + std::array({ (unsigned int)param->pad_w0, (unsigned int)param->pad_w1, + (unsigned int)param->pad_h0, (unsigned int)param->pad_h1 }), (unsigned int)param->group ); vx_node_map[ir_node->index] = deconv; diff --git a/source/device/tim-vx/op/timvx_pooling.cc b/source/device/tim-vx/op/timvx_pooling.cc index c7732eb6..75d9935d 100644 --- a/source/device/tim-vx/op/timvx_pooling.cc +++ b/source/device/tim-vx/op/timvx_pooling.cc @@ -87,7 +87,7 @@ bool VXEngine::AddPoolingNode(struct node* ir_node) auto pool = graph->CreateOperation( pooltype, - std::array({ (unsigned int)param->pad_h0, (unsigned int)param->pad_h1, (unsigned int)param->pad_w0, (unsigned int)param->pad_w1}), + std::array({ (unsigned int)param->pad_w0, (unsigned int)param->pad_w1, (unsigned int)param->pad_h0, (unsigned int)param->pad_h1}), std::array({ (unsigned int)param->kernel_w, (unsigned int)param->kernel_h}), std::array({(unsigned int)param->stride_w, (unsigned int)param->stride_h})); -- GitLab