Skip to content

Commit 2ff0b3a

Browse files
committed
tflite-micro-sync: Update esp-tflite-micro (synced from github)
1 parent ba96712 commit 2ff0b3a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tensorflow/lite/core/api/flatbuffer_conversions.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ class BuiltinDataAllocator {
4242
// deallocation.
4343
template <typename T>
4444
T* AllocatePOD() {
45-
// TODO(b/154346074): Change this to is_trivially_destructible when all
46-
// platform targets support that properly.
47-
static_assert(std::is_pod<T>::value, "Builtin data structure must be POD.");
45+
static_assert(std::is_trivially_destructible<T>::value,
46+
"Builtin data structure must be POD.");
4847
void* allocated_memory = this->Allocate(sizeof(T), alignof(T));
4948
return new (allocated_memory) T();
5049
}

tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ void FullyConnectedPerChannel(
4242
const int32_t output_activation_min = params.quantized_activation_min;
4343
const int32_t output_activation_max = params.quantized_activation_max;
4444
TFLITE_DCHECK_GE(filter_shape.DimensionsCount(), 2);
45-
TFLITE_DCHECK_EQ(output_shape.DimensionsCount(), 2);
45+
TFLITE_DCHECK_GE(output_shape.DimensionsCount(), 1);
4646

4747
TFLITE_DCHECK_LE(output_activation_min, output_activation_max);
4848
const int filter_dim_count = filter_shape.DimensionsCount();
49-
const int batches = output_shape.Dims(0);
50-
const int output_depth = output_shape.Dims(1);
49+
50+
const int output_dim_count = output_shape.DimensionsCount();
51+
const int batches = FlatSizeSkipDim(output_shape, output_dim_count - 1);
52+
const int output_depth = output_shape.Dims(output_dim_count - 1);
5153
TFLITE_DCHECK_LE(output_depth, filter_shape.Dims(filter_dim_count - 2));
5254
const int accum_depth = filter_shape.Dims(filter_dim_count - 1);
5355
for (int b = 0; b < batches; ++b) {

0 commit comments

Comments
 (0)