mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 19:20:12 +01:00
teflon: Mark dilated convolutions and fused activation as not supported
Dilation and fused activations are not yet implemented. Mark them as unsupported for now. Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31981>
This commit is contained in:
parent
319c56b10a
commit
ad0ea175d5
1 changed files with 34 additions and 2 deletions
|
|
@ -115,6 +115,11 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi
|
|||
if (node_registration->builtin_code == kTfLiteBuiltinConv2d) {
|
||||
TfLiteConvParams* params = (TfLiteConvParams*)node->builtin_data;
|
||||
|
||||
assert(params->activation == kTfLiteActNone);
|
||||
if (node_registration->version >= 2) {
|
||||
assert(params->dilation_width_factor == 1);
|
||||
assert(params->dilation_height_factor == 1);
|
||||
}
|
||||
operation->conv.stride_x = params->stride_width;
|
||||
operation->conv.stride_y = params->stride_height;
|
||||
operation->conv.padding_same = params->padding == kTfLitePaddingSame;
|
||||
|
|
@ -122,6 +127,11 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi
|
|||
} else {
|
||||
TfLiteDepthwiseConvParams* params = (TfLiteDepthwiseConvParams*)node->builtin_data;
|
||||
|
||||
assert(params->activation == kTfLiteActNone);
|
||||
if (node_registration->version >= 2) {
|
||||
assert(params->dilation_width_factor == 1);
|
||||
assert(params->dilation_height_factor == 1);
|
||||
}
|
||||
operation->conv.stride_x = params->stride_width;
|
||||
operation->conv.stride_y = params->stride_height;
|
||||
operation->conv.padding_same = params->padding == kTfLitePaddingSame;
|
||||
|
|
@ -377,8 +387,30 @@ PrepareDelegate(TfLiteContext *context, TfLiteDelegate *delegate)
|
|||
context, node_index, &node, ®istration));
|
||||
|
||||
switch(registration->builtin_code) {
|
||||
case kTfLiteBuiltinConv2d:
|
||||
case kTfLiteBuiltinDepthwiseConv2d:
|
||||
case kTfLiteBuiltinConv2d: {
|
||||
TfLiteConvParams* params = (TfLiteConvParams*)node->builtin_data;
|
||||
|
||||
// Fused activation and dilation not yet implemented
|
||||
if (params->activation == kTfLiteActNone &&
|
||||
(registration->version < 2 ||
|
||||
(params->dilation_width_factor == 1 &&
|
||||
params->dilation_height_factor == 1))) {
|
||||
supported = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kTfLiteBuiltinDepthwiseConv2d: {
|
||||
TfLiteDepthwiseConvParams* params = (TfLiteDepthwiseConvParams*)node->builtin_data;
|
||||
|
||||
// Fused activation and dilation not yet implemented
|
||||
if (params->activation == kTfLiteActNone &&
|
||||
(registration->version < 2 ||
|
||||
(params->dilation_width_factor == 1 &&
|
||||
params->dilation_height_factor == 1))) {
|
||||
supported = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kTfLiteBuiltinAdd:
|
||||
supported = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue