| 136 | } // namespace |
| 137 | |
| 138 | TfLiteStatus 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 | |
| 164 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 165 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
nothing calls this directly
no test coverage detected