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

Function EvalFloat

tensorflow/lite/kernels/fully_connected.cc:491–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489
490template <KernelType kernel_type>
491TfLiteStatus EvalFloat(TfLiteContext* context, TfLiteNode* node,
492 TfLiteFullyConnectedParams* params, OpData* data,
493 const TfLiteTensor* input, const TfLiteTensor* filter,
494 const TfLiteTensor* bias, TfLiteTensor* output) {
495 float output_activation_min, output_activation_max;
496 CalculateActivationRange(params->activation, &output_activation_min,
497 &output_activation_max);
498 if (kernel_type == kReference) {
499 FullyConnectedParams op_params;
500 op_params.float_activation_min = output_activation_min;
501 op_params.float_activation_max = output_activation_max;
502 reference_ops::FullyConnected(
503 op_params, GetTensorShape(input), GetTensorData<float>(input),
504 GetTensorShape(filter), GetTensorData<float>(filter),
505 GetTensorShape(bias), GetTensorData<float>(bias),
506 GetTensorShape(output), GetTensorData<float>(output));
507 } else if (kernel_type == kLegacyPie) {
508 return EvalPie(context, node, params, data, input, filter, bias, output);
509 } else {
510 FullyConnectedParams op_params;
511 op_params.float_activation_min = output_activation_min;
512 op_params.float_activation_max = output_activation_max;
513 optimized_ops::FullyConnected(
514 op_params, GetTensorShape(input), GetTensorData<float>(input),
515 GetTensorShape(filter), GetTensorData<float>(filter),
516 GetTensorShape(bias), GetTensorData<float>(bias),
517 GetTensorShape(output), GetTensorData<float>(output),
518 CpuBackendContext::GetFromContext(context));
519 }
520
521 return kTfLiteOk;
522}
523
524template <KernelType kernel_type>
525TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {

Callers

nothing calls this directly

Calls 4

CalculateActivationRangeFunction · 0.85
EvalPieFunction · 0.85
FullyConnectedFunction · 0.50
GetTensorShapeFunction · 0.50

Tested by

no test coverage detected