diff --git a/compiler/tflchef/core/src/Op/TransposeConv.cpp b/compiler/tflchef/core/src/Op/TransposeConv.cpp index c9e45271458..530ebae785d 100644 --- a/compiler/tflchef/core/src/Op/TransposeConv.cpp +++ b/compiler/tflchef/core/src/Op/TransposeConv.cpp @@ -34,6 +34,13 @@ flatbuffers::Offset TransposeConvChef::value(flatbuffers::FlatBufferBuilde options_builder.add_stride_h(operation.transpose_conv_options().stride_h()); options_builder.add_stride_w(operation.transpose_conv_options().stride_w()); + // TODO remove calling has_activation + auto chef_activation = operation.transpose_conv_options().has_activation() + ? operation.transpose_conv_options().activation() + : tflchef::NONE; + auto tflite_activation = as_tflite_activation(chef_activation); + options_builder.add_fused_activation_function(tflite_activation); + return options_builder.Finish().Union(); } diff --git a/compiler/tflchef/proto/tflchef.proto b/compiler/tflchef/proto/tflchef.proto index 684a71add98..98ae2b23f94 100644 --- a/compiler/tflchef/proto/tflchef.proto +++ b/compiler/tflchef/proto/tflchef.proto @@ -478,6 +478,7 @@ message TransposeConvOptions { optional Padding padding = 1 [default = VALID]; optional int32 stride_w = 2 [default = 1]; optional int32 stride_h = 3 [default = 1]; + optional Activation activation = 4 [default = NONE]; } message ReverseSequenceOptions { diff --git a/compiler/tflchef/tflite/src/Op/TransposeConv.cpp b/compiler/tflchef/tflite/src/Op/TransposeConv.cpp index 4e7adf6c692..875ccb51ba0 100644 --- a/compiler/tflchef/tflite/src/Op/TransposeConv.cpp +++ b/compiler/tflchef/tflite/src/Op/TransposeConv.cpp @@ -53,10 +53,12 @@ tflchef::Operation *TFliteOpTransposeConv::build(const tflite::Operator *op, TFl operation->set_type("TransposeConv"); auto op_options = operation->mutable_transpose_conv_options(); + auto tflchef_activation = as_tflchef_activation(op_params->fused_activation_function()); op_options->set_stride_h(op_params->stride_h()); op_options->set_stride_w(op_params->stride_w()); op_options->set_padding(as_tflchef_padding(op_params->padding())); + op_options->set_activation(tflchef_activation); return operation; }