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

Function Prepare

tensorflow/lite/kernels/expand_dims.cc:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71} // namespace
72
73TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
74 TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
75 TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
76 const TfLiteTensor* input = GetInput(context, node, kInput);
77 const TfLiteTensor* axis = GetInput(context, node, kAxis);
78 TfLiteTensor* output = GetOutput(context, node, 0);
79 output->type = input->type;
80 if (IsConstantTensor(axis)) {
81 int axis_value;
82 TF_LITE_ENSURE_OK(context,
83 GetAxisValueFromTensor(context, *axis, &axis_value));
84 return ExpandTensorDim(context, *input, axis_value, output);
85 }
86 SetTensorToDynamic(output);
87 return kTfLiteOk;
88}
89
90TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
91 // Just copy input to output.

Callers

nothing calls this directly

Calls 8

NumInputsFunction · 0.85
GetInputFunction · 0.85
GetOutputFunction · 0.85
GetAxisValueFromTensorFunction · 0.85
ExpandTensorDimFunction · 0.85
SetTensorToDynamicFunction · 0.85
NumOutputsFunction · 0.70
IsConstantTensorFunction · 0.70

Tested by

no test coverage detected