teflon: Add TANH operation support

Add the plumbing for TANH operations.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39975>
This commit is contained in:
Rob Herring (Arm) 2026-03-18 16:47:03 -05:00 committed by Marge Bot
parent df051917a5
commit 6933207435
2 changed files with 9 additions and 0 deletions

View file

@ -255,6 +255,9 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi
case kTfLiteBuiltinLogistic:
operation->type = PIPE_ML_OPERATION_TYPE_LOGISTIC;
break;
case kTfLiteBuiltinTanh:
operation->type = PIPE_ML_OPERATION_TYPE_TANH;
break;
case kTfLiteBuiltinSub:
operation->type = PIPE_ML_OPERATION_TYPE_SUBTRACT;
break;
@ -480,6 +483,9 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op
case PIPE_ML_OPERATION_TYPE_LOGISTIC:
teflon_debug("%-15s ", "LOG");
break;
case PIPE_ML_OPERATION_TYPE_TANH:
teflon_debug("%-15s ", "TANH");
break;
case PIPE_ML_OPERATION_TYPE_SUBTRACT:
teflon_debug("%-15s ", "SUB");
break;
@ -722,6 +728,8 @@ tflite_builtin_op_name(TfLiteBuiltinOperator op)
return "ABS";
case kTfLiteBuiltinLogistic:
return "LOG";
case kTfLiteBuiltinTanh:
return "TANH";
case kTfLiteBuiltinSub:
return "SUB";
case kTfLiteBuiltinTranspose:

View file

@ -1061,6 +1061,7 @@ enum pipe_ml_operation_type {
PIPE_ML_OPERATION_TYPE_RELU,
PIPE_ML_OPERATION_TYPE_ABSOLUTE,
PIPE_ML_OPERATION_TYPE_LOGISTIC,
PIPE_ML_OPERATION_TYPE_TANH,
PIPE_ML_OPERATION_TYPE_SUBTRACT,
PIPE_ML_OPERATION_TYPE_TRANSPOSE,
PIPE_ML_OPERATION_TYPE_STRIDED_SLICE,