| 158 | } |
| 159 | |
| 160 | TfLiteStatus 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 | |
| 183 | TfLiteStatus ResizeAndTransposeWeights(TfLiteContext* context, |
| 184 | const TfLiteTensor* weights, |
no test coverage detected