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

Function ResizeTensor

tensorflow/lite/kernels/transpose_conv.cc:97–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97TfLiteStatus ResizeTensor(TfLiteContext* context,
98 const TfLiteTensor* shape_tensor,
99 TfLiteTensor* tensor_to_resize) {
100 // Currently only support int32 for output shape.
101 if (shape_tensor->type != kTfLiteInt32) {
102 context->ReportError(context, "Output shape is %d, not int32.",
103 shape_tensor->type);
104 return kTfLiteError;
105 }
106
107 TfLiteIntArray* shape = TfLiteIntArrayCreate(NumElements(shape_tensor));
108 for (int i = 0; i < shape->size; ++i) {
109 shape->data[i] = GetTensorData<int32_t>(shape_tensor)[i];
110 }
111
112 return context->ResizeTensor(context, tensor_to_resize, shape);
113}
114
115// Allocate temporary tensors if necessary.
116template <KernelType kernel_type>

Callers 2

PrepareFunction · 0.70
EvalFunction · 0.70

Calls 4

TfLiteIntArrayCreateFunction · 0.85
ResizeTensorMethod · 0.80
NumElementsFunction · 0.70
ReportErrorMethod · 0.45

Tested by

no test coverage detected