| 35 | constexpr int kOutputTensor = 0; |
| 36 | |
| 37 | TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { |
| 38 | TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); |
| 39 | TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); |
| 40 | |
| 41 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
| 42 | TfLiteTensor* output = GetOutput(context, node, kOutputTensor); |
| 43 | |
| 44 | TF_LITE_ENSURE_EQ(context, NumDimensions(input), 4); |
| 45 | |
| 46 | TF_LITE_ENSURE_EQ(context, output->type, kTfLiteFloat32); |
| 47 | TF_LITE_ENSURE_EQ(context, input->type, output->type); |
| 48 | |
| 49 | TfLiteIntArray* output_size = TfLiteIntArrayCreate(4); |
| 50 | output_size->data[0] = input->dims->data[0]; |
| 51 | output_size->data[1] = input->dims->data[1]; |
| 52 | output_size->data[2] = input->dims->data[2]; |
| 53 | output_size->data[3] = input->dims->data[3]; |
| 54 | |
| 55 | return context->ResizeTensor(context, output, output_size); |
| 56 | } |
| 57 | |
| 58 | template <KernelType kernel_type> |
| 59 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
nothing calls this directly
no test coverage detected