File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
tensorflow/lite/micro/kernels/cmsis_nn Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,12 @@ inline TfLiteStatus PopulateEvalData(
121
121
RuntimeShape tmp_r = SwapRowColumnDims (*rhs_shape);
122
122
rhs_shape->ReplaceWith (tmp_r.DimensionsCount (), tmp_r.DimsData ());
123
123
}
124
- if (!params->adj_x ) {
124
+ // ReferenceOps and CMSIS-NN have different requirements for when the
125
+ // lhs shape should be transposed, so we have to treat float differently.
126
+ if (!params->adj_x && original_lhs_input->type == kTfLiteFloat32 ) {
127
+ RuntimeShape tmp_l = SwapRowColumnDims (*lhs_shape);
128
+ lhs_shape->ReplaceWith (tmp_l.DimensionsCount (), tmp_l.DimsData ());
129
+ } else if (params->adj_x && original_lhs_input->type != kTfLiteFloat32 ) {
125
130
RuntimeShape tmp_l = SwapRowColumnDims (*lhs_shape);
126
131
lhs_shape->ReplaceWith (tmp_l.DimensionsCount (), tmp_l.DimsData ());
127
132
}
You can’t perform that action at this time.
0 commit comments