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

Function Eval

tensorflow/lite/kernels/cast.cc:101–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
102 const TfLiteTensor* input = GetInput(context, node, kInputTensor);
103 TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
104 const int num_elements = NumElements(input);
105 TF_LITE_ENSURE_EQ(context, num_elements, NumElements(output));
106 switch (input->type) {
107 case kTfLiteInt64:
108 return copyToTensor(input->data.i64, output, num_elements);
109 case kTfLiteInt32:
110 return copyToTensor(input->data.i32, output, num_elements);
111 case kTfLiteUInt8:
112 return copyToTensor(input->data.uint8, output, num_elements);
113 case kTfLiteFloat32:
114 return copyToTensor(input->data.f, output, num_elements);
115 case kTfLiteBool:
116 return copyToTensor(input->data.b, output, num_elements);
117 case kTfLiteComplex64:
118 return copyToTensor(
119 reinterpret_cast<std::complex<float>*>(input->data.c64), output,
120 num_elements);
121 default:
122 // Unsupported type.
123 return kTfLiteError;
124 }
125 return kTfLiteOk;
126}
127} // namespace cast
128
129TfLiteRegistration* Register_CAST() {

Callers

nothing calls this directly

Calls 4

GetInputFunction · 0.85
GetOutputFunction · 0.85
copyToTensorFunction · 0.85
NumElementsFunction · 0.70

Tested by

no test coverage detected