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

Function ResizeCol2ImTensor

tensorflow/lite/kernels/transpose_conv.cc:160–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160TfLiteStatus ResizeCol2ImTensor(TfLiteContext* context,
161 const TfLiteTensor* output_shape,
162 const TfLiteTensor* weights,
163 const TfLiteTensor* input,
164 TfLiteTensor* col2im) {
165 if (output_shape->type != kTfLiteInt32) {
166 context->ReportError(context, "col2im shape is %d, not int32.",
167 output_shape->type);
168 return kTfLiteError;
169 }
170 TF_LITE_ENSURE_EQ(context, NumElements(output_shape), 4);
171 TfLiteIntArray* col2im_shape_array = TfLiteIntArrayCreate(2);
172 const RuntimeShape& input_shape = GetTensorShape(input);
173 const RuntimeShape& weights_shape = GetTensorShape(weights);
174 col2im_shape_array->data[0] = input_shape.Dims(1) * input_shape.Dims(2);
175 col2im_shape_array->data[1] =
176 weights_shape.Dims(0) * weights_shape.Dims(1) * weights_shape.Dims(2);
177
178 col2im->type = input->type;
179 col2im->allocation_type = kTfLiteDynamic;
180 return context->ResizeTensor(context, col2im, col2im_shape_array);
181}
182
183TfLiteStatus ResizeAndTransposeWeights(TfLiteContext* context,
184 const TfLiteTensor* weights,

Callers 2

PrepareFunction · 0.85
EvalFunction · 0.85

Calls 6

TfLiteIntArrayCreateFunction · 0.85
DimsMethod · 0.80
ResizeTensorMethod · 0.80
NumElementsFunction · 0.70
GetTensorShapeFunction · 0.50
ReportErrorMethod · 0.45

Tested by

no test coverage detected