From e06265ed3a7bc41be38593957292adc7b2b32caa Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 9 Dec 2024 16:37:56 +0100 Subject: [PATCH] teflon: Only mark integers as signed As these are the types that need special handling, eg. not kTfLiteFloat32. Part-of: --- src/gallium/frontends/teflon/tfl_device.c | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index 68bf1c9c95b..cfda6531b64 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -242,14 +242,14 @@ fill_tensor(struct teflon_delegate *delegate, TfLiteContext *tf_context, struct } switch(tf_tensor.type) { - case kTfLiteUInt8: - case kTfLiteUInt16: - case kTfLiteUInt32: - case kTfLiteUInt64: - tensor->is_signed = false; + case kTfLiteInt8: + case kTfLiteInt16: + case kTfLiteInt32: + case kTfLiteInt64: + tensor->is_signed = true; break; default: - tensor->is_signed = true; + tensor->is_signed = false; } } @@ -440,10 +440,10 @@ partition_invoke(TfLiteContext *tf_context, TfLiteNode *node) TfLiteTensor tf_tensor = tf_context->tensors[tsubgraph->input_tensors[i]]; buffers[i] = tf_tensor.data.data; - is_signed[i] = !(tf_tensor.type == kTfLiteUInt8 || - tf_tensor.type == kTfLiteUInt16 || - tf_tensor.type == kTfLiteUInt32 || - tf_tensor.type == kTfLiteUInt64); + is_signed[i] = tf_tensor.type == kTfLiteInt8 || + tf_tensor.type == kTfLiteInt16 || + tf_tensor.type == kTfLiteInt32 || + tf_tensor.type == kTfLiteInt64; } context->ml_subgraph_invoke(context, subgraph, tsubgraph->input_count, tsubgraph->input_tensors, buffers, is_signed); free(buffers); @@ -455,10 +455,10 @@ partition_invoke(TfLiteContext *tf_context, TfLiteNode *node) TfLiteTensor tf_tensor = tf_context->tensors[tsubgraph->output_tensors[i]]; buffers[i] = tf_tensor.data.data; - is_signed[i] = !(tf_tensor.type == kTfLiteUInt8 || - tf_tensor.type == kTfLiteUInt16 || - tf_tensor.type == kTfLiteUInt32 || - tf_tensor.type == kTfLiteUInt64); + is_signed[i] = tf_tensor.type == kTfLiteInt8 || + tf_tensor.type == kTfLiteInt16 || + tf_tensor.type == kTfLiteInt32 || + tf_tensor.type == kTfLiteInt64; } context->ml_subgraph_read_output(context, subgraph, tsubgraph->output_count, tsubgraph->output_tensors, buffers, is_signed); free(buffers);