DECODE fix channel count for non-quantized tensors - #3691
ddavis-2015 wants to merge 6 commits into
Conversation
@tensorflow/micro This is part 1 of 2 to add support for custom DECODE operators and their registration. Part 2 will add this support to the Python MicroInterpreter wrapper. Add unit tests for custom DECODE operator registration. Re-enable -Werror in the Makefile. Fix minor comment typos. bug=fixes tensorflow#3215
@tensorflow/micro Bring DECODE operator LUT and pruning channel count discovery in-line with design documentation. This fixes the channel count always being 1 (one) for non-quantized tensors. Parse additional field in DCM. Update unit tests. bug=fixes tensorflow#3685
@tensorflow/micro Put the -Werror flag back into the primary makefile, to prevent creaping warning accumulation. Fix various warning generators in codebase. bug=fixes tensorflow#3689
|
One more release-only edge in the new axis-resolution block, in both the const uint8_t axis = axis_mask >> kDcmParamsAxisMaskShift;
TFLITE_DCHECK(axis < NumDimensions(&output));
num_channels_ = SizeOfDimension(&output, axis);
// tensorflow/lite/kernels/kernel_util.h:153-155
inline int SizeOfDimension(const TfLiteTensor* t, int dim) {
return t->dims->data[dim];
}So a model with
Since this rework derives the channel count from the shape precisely so TF_LITE_ENSURE_MSG(const_cast<TfLiteContext*>(context_),
axis < NumDimensions(&output),
"unsupported channel axis %u for output rank %d", axis,
NumDimensions(&output));
num_channels_ = SizeOfDimension(&output, axis);Two adjacent cases in the same block worth covering at the same time:
The generator side already validates the axis at model-creation time |
|
@alencheung Please do not submit unsolicited comments on draft PRs. |
@tensorflow/micro
Bring DECODE operator LUT and pruning channel count discovery in-line with design documentation. This fixes the channel count always being 1 (one) for non-quantized tensors.
Parse additional field in DCM.
Update unit tests.
bug=fixes #3685