mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
teflon: Add LeakyRelu operation
Add the plumbing for LeakyRelu 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:
parent
3487b15312
commit
15bc152185
2 changed files with 17 additions and 0 deletions
|
|
@ -246,6 +246,13 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi
|
|||
memcpy(operation->reshape.shape, shape, 4 * sizeof(*operation->reshape.shape));
|
||||
break;
|
||||
}
|
||||
case kTfLiteBuiltinLeakyRelu: {
|
||||
TfLiteLeakyReluParams *params = node->builtin_data;
|
||||
|
||||
operation->type = PIPE_ML_OPERATION_TYPE_LEAKY_RELU;
|
||||
operation->leakyrelu.alpha = params->alpha;
|
||||
break;
|
||||
}
|
||||
case kTfLiteBuiltinRelu:
|
||||
operation->type = PIPE_ML_OPERATION_TYPE_RELU;
|
||||
break;
|
||||
|
|
@ -507,6 +514,9 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op
|
|||
case PIPE_ML_OPERATION_TYPE_MUL:
|
||||
teflon_debug("%-15s ", "MUL");
|
||||
break;
|
||||
case PIPE_ML_OPERATION_TYPE_LEAKY_RELU:
|
||||
teflon_debug("%-15s ", "LEAKY_RELU");
|
||||
break;
|
||||
}
|
||||
|
||||
char *input_buf = ralloc_strdup(NULL, "");
|
||||
|
|
@ -740,6 +750,8 @@ tflite_builtin_op_name(TfLiteBuiltinOperator op)
|
|||
return "SUB";
|
||||
case kTfLiteBuiltinTranspose:
|
||||
return "TRANSPOSE";
|
||||
case kTfLiteBuiltinLeakyRelu:
|
||||
return "LEAKY_RELU";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1068,6 +1068,7 @@ enum pipe_ml_operation_type {
|
|||
PIPE_ML_OPERATION_TYPE_STRIDED_SLICE,
|
||||
PIPE_ML_OPERATION_TYPE_RESIZE,
|
||||
PIPE_ML_OPERATION_TYPE_MUL,
|
||||
PIPE_ML_OPERATION_TYPE_LEAKY_RELU,
|
||||
};
|
||||
|
||||
enum pipe_ml_pooling_type {
|
||||
|
|
@ -1268,6 +1269,10 @@ struct pipe_ml_operation
|
|||
int end[4];
|
||||
int strides[4];
|
||||
} slice;
|
||||
|
||||
struct {
|
||||
float alpha;
|
||||
} leakyrelu;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue