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

Function Eval

tensorflow/lite/experimental/micro/kernels/neg.cc:30–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28constexpr int kOutputTensor = 0;
29
30TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
31 const TfLiteTensor* input = GetInput(context, node, kInputTensor);
32 TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
33 switch (input->type) {
34 // TODO(wangtz): handle for kTfLiteInt8
35 case kTfLiteFloat32:
36 reference_ops::Negate(GetTensorShape(input), GetTensorData<float>(input),
37 GetTensorShape(output),
38 GetTensorData<float>(output));
39 break;
40 default:
41 context->ReportError(
42 context, "Neg only currently supports float32, got %d.", input->type);
43 return kTfLiteError;
44 }
45 return kTfLiteOk;
46}
47
48} // namespace neg
49

Callers 1

RunMethod · 0.50

Calls 5

GetInputFunction · 0.85
GetOutputFunction · 0.85
NegateFunction · 0.85
GetTensorShapeFunction · 0.50
ReportErrorMethod · 0.45

Tested by 1

RunMethod · 0.40