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

Function EvalImpl

tensorflow/lite/experimental/micro/kernels/elementwise.cc:53–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52template <typename T>
53inline TfLiteStatus EvalImpl(TfLiteContext* context, TfLiteNode* node,
54 T func(T), TfLiteType expected_type) {
55 const TfLiteTensor* input = GetInput(context, node, 0);
56 TfLiteTensor* output = GetOutput(context, node, 0);
57 TF_LITE_ENSURE_EQ(context, input->type, expected_type);
58 const int64_t num_elements = NumElements(input);
59 const T* in_data = GetTensorData<T>(input);
60 T* out_data = GetTensorData<T>(output);
61 for (int64_t i = 0; i < num_elements; ++i) {
62 out_data[i] = func(in_data[i]);
63 }
64 return kTfLiteOk;
65}
66
67inline TfLiteStatus EvalNumeric(TfLiteContext* context, TfLiteNode* node,
68 float float_func(float)) {

Callers

nothing calls this directly

Calls 4

GetInputFunction · 0.85
GetOutputFunction · 0.85
NumElementsFunction · 0.50
funcFunction · 0.50

Tested by

no test coverage detected