diff --git a/compiler/luci-interpreter/src/core/KernelParams.h b/compiler/luci-interpreter/src/core/KernelParams.h index ea7ac4804e7..4ddbcefb8ea 100644 --- a/compiler/luci-interpreter/src/core/KernelParams.h +++ b/compiler/luci-interpreter/src/core/KernelParams.h @@ -221,6 +221,7 @@ struct TransposeConvParams Padding padding; int32_t stride_height; int32_t stride_width; + Activation activation; }; struct UnidirectionalSequenceLSTMParams diff --git a/compiler/luci-interpreter/src/kernels/TransposeConv.test.cpp b/compiler/luci-interpreter/src/kernels/TransposeConv.test.cpp index 4856e1b87d2..8e9cfc6adaf 100644 --- a/compiler/luci-interpreter/src/kernels/TransposeConv.test.cpp +++ b/compiler/luci-interpreter/src/kernels/TransposeConv.test.cpp @@ -54,6 +54,7 @@ void Check(std::initializer_list output_shape_shape, params.padding = padding; params.stride_height = stride_height; params.stride_width = stride_width; + params.activation = luci::FusedActFunc::NONE; if (bias_data.size() != 0) { @@ -164,6 +165,7 @@ TEST(TransposeConvTest, UInt8) params.padding = Padding::VALID; params.stride_height = 2; params.stride_width = 2; + params.activation = luci::FusedActFunc::NONE; TransposeConv kernel(&output_shape_tensor, &filter_tensor, &input_tensor, &bias_tensor, &output_tensor, &scratch_tensor, params); @@ -232,6 +234,7 @@ TEST(TransposeConvTest, UInt8_CWQ) params.padding = Padding::VALID; params.stride_height = 2; params.stride_width = 2; + params.activation = luci::FusedActFunc::NONE; TransposeConv kernel(&output_shape_tensor, &filter_tensor, &input_tensor, &bias_tensor, &output_tensor, &scratch_tensor, params); @@ -278,6 +281,7 @@ TEST(TransposeConvTest, SInt16) params.padding = Padding::VALID; params.stride_height = 2; params.stride_width = 2; + params.activation = luci::FusedActFunc::NONE; TransposeConv kernel(&output_shape_tensor, &filter_tensor, &input_tensor, &bias_tensor, &output_tensor, &scratch_tensor, params); @@ -336,6 +340,7 @@ TEST(TransposeConvTest, SInt16_CWQ_weights) params.padding = Padding::VALID; params.stride_height = 2; params.stride_width = 2; + params.activation = luci::FusedActFunc::NONE; TransposeConv kernel(&output_shape_tensor, &filter_tensor, &input_tensor, &bias_tensor, &output_tensor, &scratch_tensor, params); diff --git a/compiler/luci-interpreter/src/loader/KernelBuilder.test.cpp b/compiler/luci-interpreter/src/loader/KernelBuilder.test.cpp index b221b6921d5..10a01f4180a 100644 --- a/compiler/luci-interpreter/src/loader/KernelBuilder.test.cpp +++ b/compiler/luci-interpreter/src/loader/KernelBuilder.test.cpp @@ -1319,6 +1319,7 @@ TEST_F(KernelBuilderTest, TransposeConv) op->padding(luci::Padding::SAME); op->stride()->h(11); op->stride()->w(13); + op->fusedActivationFunction(luci::FusedActFunc::NONE); auto kernel = buildKernel(op); ASSERT_THAT(kernel, NotNull()); @@ -1331,6 +1332,7 @@ TEST_F(KernelBuilderTest, TransposeConv) EXPECT_THAT(kernel->params().padding, Eq(op->padding())); EXPECT_THAT(kernel->params().stride_height, Eq(op->stride()->h())); EXPECT_THAT(kernel->params().stride_width, Eq(op->stride()->w())); + EXPECT_THAT(kernel->params().activation, Eq(op->fusedActivationFunction())); } TEST_F(KernelBuilderTest, Unpack) diff --git a/compiler/luci-interpreter/src/loader/nodes/TransposeConv.cpp b/compiler/luci-interpreter/src/loader/nodes/TransposeConv.cpp index d773e301ea3..72d1aecf742 100644 --- a/compiler/luci-interpreter/src/loader/nodes/TransposeConv.cpp +++ b/compiler/luci-interpreter/src/loader/nodes/TransposeConv.cpp @@ -47,6 +47,13 @@ std::unique_ptr build_kernel_CircleTransposeConv(const luci::CircleNode params.padding = node->padding(); params.stride_height = node->stride()->h(); params.stride_width = node->stride()->w(); + params.activation = node->fusedActivationFunction(); + + // TODO support activation + if (params.activation != luci::FusedActFunc::NONE) + { + throw std::runtime_error("Unsupported activation of TransposeConv"); + } return std::make_unique(input_sizes, filter, out_backprop, bias, output, tmp, params);