| 99 | } |
| 100 | |
| 101 | TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { |
| 102 | TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); |
| 103 | TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); |
| 104 | |
| 105 | BatchToSpaceNDContext op_context(context, node); |
| 106 | TF_LITE_ENSURE_EQ(context, NumDimensions(op_context.input), |
| 107 | kInputDimensionNum); |
| 108 | TF_LITE_ENSURE_EQ(context, op_context.input->type, op_context.output->type); |
| 109 | |
| 110 | if (!IsConstantTensor(op_context.block_shape) || |
| 111 | !IsConstantTensor(op_context.crops)) { |
| 112 | SetTensorToDynamic(op_context.output); |
| 113 | return kTfLiteOk; |
| 114 | } |
| 115 | return ResizeOutputTensor(context, &op_context); |
| 116 | } |
| 117 | |
| 118 | template <KernelType kernel_type> |
| 119 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
nothing calls this directly
no test coverage detected