MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Prepare

Function Prepare

tensorflow/lite/kernels/maximum_minimum.cc:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47};
48
49TfLiteStatus 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
72struct MaximumOp {
73 template <typename data_type>

Callers

nothing calls this directly

Calls 6

NumInputsFunction · 0.85
HaveSameShapesFunction · 0.85
TfLiteIntArrayCopyFunction · 0.85
ResizeTensorMethod · 0.80
NumOutputsFunction · 0.70

Tested by

no test coverage detected