diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index 9fc6464d419..d6df4955b93 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -182,9 +182,14 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi operation->pooling.padding_same = params->padding == kTfLitePaddingSame; break; } - case kTfLiteBuiltinAdd: + case kTfLiteBuiltinAdd: { + TfLiteAddParams *params = (TfLiteAddParams *)node->builtin_data; + operation->type = PIPE_ML_OPERATION_TYPE_ADD; + operation->add.relu = params->activation == kTfLiteActRelu || + params->activation == kTfLiteActRelu6; break; + } case kTfLiteBuiltinConcatenation: { TfLiteConcatenationParams *params = node->builtin_data; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 229321d5caa..98d6e6feeb9 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1220,6 +1220,13 @@ struct pipe_ml_operation bool relu; } fcon; + struct { + /** + * Whether a ReLU activation should be applied to the output. + */ + bool relu; + } add; + struct { /** * Dimension along which the tensors are concatenated.