| 44 | } |
| 45 | |
| 46 | TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { |
| 47 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
| 48 | TfLiteTensor* output = GetOutput(context, node, kOutputTensor); |
| 49 | const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers); |
| 50 | |
| 51 | const int num_dimensions = NumDimensions(input); |
| 52 | const int num_multipliers = NumElements(multipliers); |
| 53 | TF_LITE_ENSURE_EQ(context, num_dimensions, num_multipliers); |
| 54 | switch (multipliers->type) { |
| 55 | case kTfLiteInt32: |
| 56 | return context->ResizeTensor( |
| 57 | context, output, |
| 58 | MultiplyShapeDims<int32_t>(*input->dims, multipliers, |
| 59 | num_dimensions)); |
| 60 | case kTfLiteInt64: |
| 61 | return context->ResizeTensor( |
| 62 | context, output, |
| 63 | MultiplyShapeDims<int64_t>(*input->dims, multipliers, |
| 64 | num_dimensions)); |
| 65 | default: |
| 66 | context->ReportError( |
| 67 | context, "Multipliers of type '%s' are not supported by tile.", |
| 68 | TfLiteTypeGetName(multipliers->type)); |
| 69 | return kTfLiteError; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | template <typename T, typename M> |
| 74 | void CopyMultipleTimes(const T* in_data, int32_t in_size, M multiplier, |
no test coverage detected