| 47 | }; |
| 48 | |
| 49 | TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { |
| 50 | TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); |
| 51 | TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); |
| 52 | |
| 53 | OpContext op_context(context, node); |
| 54 | TF_LITE_ENSURE_EQ(context, op_context.input1->type, op_context.input2->type); |
| 55 | op_context.output->type = op_context.input1->type; |
| 56 | |
| 57 | bool requires_broadcast = |
| 58 | !HaveSameShapes(op_context.input1, op_context.input2); |
| 59 | |
| 60 | TfLiteIntArray* output_size = nullptr; |
| 61 | if (requires_broadcast) { |
| 62 | TF_LITE_ENSURE_OK( |
| 63 | context, CalculateShapeForBroadcast(context, op_context.input1, |
| 64 | op_context.input2, &output_size)); |
| 65 | } else { |
| 66 | output_size = TfLiteIntArrayCopy(op_context.input1->dims); |
| 67 | } |
| 68 | |
| 69 | return context->ResizeTensor(context, op_context.output, output_size); |
| 70 | } |
| 71 | |
| 72 | struct MaximumOp { |
| 73 | template <typename data_type> |
nothing calls this directly
no test coverage detected