Skip to content

Commit

Permalink
Fix hifimini errors
Browse files Browse the repository at this point in the history
  • Loading branch information
njeffrie committed Feb 25, 2021
1 parent 2eaf7d1 commit 3016266
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions tensorflow/lite/micro/kernels/xtensa/conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
return kTfLiteOk;
}

#if defined(Fusion_F1)
TfLiteStatus EvalHifi4(TfLiteContext* context, TfLiteNode* node,
const TfLiteConvParams& params, const OpData& data,
const TfLiteEvalTensor* input,
Expand Down Expand Up @@ -408,6 +409,7 @@ TfLiteStatus EvalHifi4(TfLiteContext* context, TfLiteNode* node,
tflite::micro::GetTensorData<int8_t>(output));
return kTfLiteOk;
}
#endif // defined(Fusion_F1)

TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TFLITE_DCHECK(node->user_data != nullptr);
Expand Down
25 changes: 14 additions & 11 deletions tensorflow/lite/micro/kernels/xtensa/depthwise_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
return kTfLiteOk;
}

#if defined(Fusion_F1)
TfLiteStatus EvalHifi4(TfLiteContext* context, TfLiteNode* node,
const TfLiteDepthwiseConvParams& params,
const OpData& data, const TfLiteEvalTensor* input,
Expand Down Expand Up @@ -438,6 +439,7 @@ TfLiteStatus EvalHifi4(TfLiteContext* context, TfLiteNode* node,

return kTfLiteOk;
}
#endif // defined(FUSION_F1)

TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TFLITE_DCHECK(node->user_data != nullptr);
Expand Down Expand Up @@ -485,17 +487,18 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
switch (input->type) { // Already know in/out types are same.
case kTfLiteInt8: {
#if defined(HIFIMINI)
EvalHifiMini(DepthwiseConvParamsQuantized(params, data.reference_op_data),
data.reference_op_data.per_channel_output_multiplier,
data.reference_op_data.per_channel_output_shift,
tflite::micro::GetTensorShape(input),
tflite::micro::GetTensorData<int8_t>(input),
tflite::micro::GetTensorShape(filter),
tflite::micro::GetTensorData<int8_t>(filter),
tflite::micro::GetTensorShape(bias),
tflite::micro::GetTensorData<int32_t>(bias),
tflite::micro::GetTensorShape(output),
tflite::micro::GetTensorData<int8_t>(output));
EvalHifiMini(
DepthwiseConvParamsQuantized(params, op_data.reference_op_data),
op_data.reference_op_data.per_channel_output_multiplier,
op_data.reference_op_data.per_channel_output_shift,
tflite::micro::GetTensorShape(input),
tflite::micro::GetTensorData<int8_t>(input),
tflite::micro::GetTensorShape(filter),
tflite::micro::GetTensorData<int8_t>(filter),
tflite::micro::GetTensorShape(bias),
tflite::micro::GetTensorData<int32_t>(bias),
tflite::micro::GetTensorShape(output),
tflite::micro::GetTensorData<int8_t>(output));
#elif defined(FUSION_F1)
EvalHifi4(context, node, params, op_data, input, filter, bias, output);
#else
Expand Down

0 comments on commit 3016266

Please sign in to comment.