| 71 | } // namespace |
| 72 | |
| 73 | TfLiteStatus 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 | |
| 90 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 91 | // Just copy input to output. |
nothing calls this directly
no test coverage detected