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

Function ResizeOutput

tensorflow/lite/kernels/range.cc:47–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47TfLiteStatus ResizeOutput(TfLiteContext* context, const TfLiteTensor* start,
48 const TfLiteTensor* limit, const TfLiteTensor* delta,
49 TfLiteTensor* output) {
50 // The output will always be a 1-d array.
51 int size = 0;
52 switch (start->type) {
53 case kTfLiteInt32: {
54 TF_LITE_ENSURE_OK(context,
55 GetSize(context, *GetTensorData<int32_t>(start),
56 *GetTensorData<int32_t>(limit),
57 *GetTensorData<int32_t>(delta), &size));
58 break;
59 }
60 case kTfLiteFloat32: {
61 TF_LITE_ENSURE_OK(context, GetSize(context, *GetTensorData<float>(start),
62 *GetTensorData<float>(limit),
63 *GetTensorData<float>(delta), &size));
64 break;
65 }
66 default: {
67 context->ReportError(context, "Unknown data type: %d", start->type);
68 return kTfLiteError;
69 }
70 }
71 TfLiteIntArray* output_shape_array = TfLiteIntArrayCreate(1);
72 output_shape_array->data[0] = size;
73 return context->ResizeTensor(context, output, output_shape_array);
74}
75
76TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
77 TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);

Callers 2

PrepareFunction · 0.70
EvalFunction · 0.70

Calls 4

GetSizeFunction · 0.85
TfLiteIntArrayCreateFunction · 0.85
ResizeTensorMethod · 0.80
ReportErrorMethod · 0.45

Tested by

no test coverage detected