MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Eval

Function Eval

tensorflow/lite/kernels/depthwise_conv.cc:300–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298
299template <KernelType kernel_type>
300TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
301 auto* params =
302 reinterpret_cast<TfLiteDepthwiseConvParams*>(node->builtin_data);
303 OpData* data = reinterpret_cast<OpData*>(node->user_data);
304
305 TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
306 const TfLiteTensor* input = GetInput(context, node, kInputTensor);
307 const TfLiteTensor* filter = GetInput(context, node, kFilterTensor);
308 const TfLiteTensor* bias =
309 (NumInputs(node) == 3) ? GetInput(context, node, kBiasTensor) : nullptr;
310
311 // TODO(aselle): Consider whether float conv and quantized conv should be
312 // separate ops to avoid dispatch overhead here.
313 switch (input->type) { // Already know in/out types are same.
314 case kTfLiteFloat32:
315 EvalFloat<kernel_type>(context, node, params, data, input, filter, bias,
316 output);
317 break;
318 case kTfLiteUInt8:
319 EvalQuantized<kernel_type>(context, node, params, data, input, filter,
320 bias, output);
321 break;
322 case kTfLiteInt8: {
323 EvalQuantizedPerChannel<kernel_type>(context, node, params, data, input,
324 filter, bias, output);
325 break;
326 }
327 default:
328 context->ReportError(context, "Type %d not currently supported.",
329 input->type);
330 return kTfLiteError;
331 }
332 return kTfLiteOk;
333}
334
335} // namespace depthwise_conv
336

Callers

nothing calls this directly

Calls 4

GetOutputFunction · 0.85
GetInputFunction · 0.85
NumInputsFunction · 0.85
ReportErrorMethod · 0.45

Tested by

no test coverage detected