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

Function Prepare

tensorflow/lite/kernels/tile.cc:138–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136} // namespace
137
138TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
139 TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
140 TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
141
142 const TfLiteTensor* input = GetInput(context, node, kInputTensor);
143
144 TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
145 TF_LITE_ENSURE_EQ(context, input->type, output->type);
146
147 const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers);
148 // Only int32 and int64 multipliers type is supported.
149 if (multipliers->type != kTfLiteInt32 && multipliers->type != kTfLiteInt64) {
150 context->ReportError(context,
151 "Multipliers of type '%s' are not supported by tile.",
152 TfLiteTypeGetName(multipliers->type));
153 return kTfLiteError;
154 }
155
156 if (IsConstantTensor(multipliers)) {
157 TF_LITE_ENSURE_OK(context, ResizeOutput(context, node));
158 } else {
159 SetTensorToDynamic(output);
160 }
161 return kTfLiteOk;
162}
163
164TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
165 const TfLiteTensor* input = GetInput(context, node, kInputTensor);

Callers

nothing calls this directly

Calls 9

NumInputsFunction · 0.85
GetInputFunction · 0.85
GetOutputFunction · 0.85
TfLiteTypeGetNameFunction · 0.85
SetTensorToDynamicFunction · 0.85
NumOutputsFunction · 0.70
IsConstantTensorFunction · 0.70
ResizeOutputFunction · 0.70
ReportErrorMethod · 0.45

Tested by

no test coverage detected