Skip to content

Commit 3d2f253

Browse files
ddavis-2015veblush
authored andcommitted
Adjust TestConvModelMemoryThreshold values due to updated test_conv_model.cc
1 parent ceaaa3c commit 3d2f253

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tensorflow/lite/micro/memory_arena_threshold_test.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ constexpr int kKeywordModelOpRuntimeDataSize = 148;
8282
constexpr int kTestConvModelArenaSize = 12 * 1024;
8383
uint8_t test_conv_tensor_arena[kTestConvModelArenaSize];
8484

85-
constexpr int kTestConvModelTensorCount = 15;
86-
constexpr int kTestConvModelNodeAndRegistrationCount = 7;
85+
constexpr int kTestConvModelTensorCount = 13;
86+
constexpr int kTestConvModelNodeAndRegistrationCount = 5;
8787

8888
#if defined(USE_TFLM_COMPRESSION)
8989
constexpr int kKeywordModelPersistentBufferDataSize = 920;
@@ -101,9 +101,9 @@ constexpr int kTestConvModelOnlyTotalSize = 9576;
101101
// Tail size contributed by the conv model excluding the
102102
// RecordingMicroAllocator's overhead
103103
// TODO(b/207157610): replace magic number that depends on OPs
104-
constexpr int kTestConvModelOnlyTailSize = 1832;
104+
constexpr int kTestConvModelOnlyTailSize = 1672;
105105
constexpr int kTestConvModelPersistentTfLiteTensorDataSize = 128;
106-
constexpr int kTestConvModelPersistentBufferDataSize = 748;
106+
constexpr int kTestConvModelPersistentBufferDataSize = 700;
107107
#else
108108
// Total size contributed by the conv model excluding the
109109
// RecordingMicroAllocator's overhead
@@ -112,13 +112,13 @@ constexpr int kTestConvModelOnlyTotalSize = 9832;
112112
// Tail size contributed by the conv model excluding the
113113
// RecordingMicroAllocator's overhead
114114
// TODO(b/207157610): replace magic number that depends on OPs
115-
constexpr int kTestConvModelOnlyTailSize = 2088;
115+
constexpr int kTestConvModelOnlyTailSize = 1928;
116116
constexpr int kTestConvModelPersistentTfLiteTensorDataSize = 224;
117-
constexpr int kTestConvModelPersistentBufferDataSize = 740;
117+
constexpr int kTestConvModelPersistentBufferDataSize = 692;
118118
#endif
119119
constexpr int kTestConvModelHeadSize = 7744;
120120
constexpr int kTestConvModelOpRuntimeDataSize = 136;
121-
constexpr int kTestConvModelPersistentTfLiteTensorQuantizationData = 0;
121+
constexpr int kTestConvModelPersistentTfLiteTensorQuantizationData = 64;
122122

123123
struct ModelAllocationThresholds {
124124
size_t tensor_count = 0;
@@ -262,13 +262,11 @@ TF_LITE_MICRO_TEST(TestKeywordModelMemoryThreshold) {
262262
}
263263

264264
TF_LITE_MICRO_TEST(TestConvModelMemoryThreshold) {
265-
tflite::MicroMutableOpResolver<6> op_resolver;
265+
tflite::MicroMutableOpResolver<4> op_resolver;
266266
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddConv2D(), kTfLiteOk);
267-
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddQuantize(), kTfLiteOk);
268267
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddMaxPool2D(), kTfLiteOk);
269268
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddReshape(), kTfLiteOk);
270269
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddFullyConnected(), kTfLiteOk);
271-
TF_LITE_MICRO_EXPECT_EQ(op_resolver.AddDequantize(), kTfLiteOk);
272270

273271
tflite::RecordingMicroInterpreter interpreter(
274272
tflite::GetModel(kTestConvModelData), op_resolver, test_conv_tensor_arena,

0 commit comments

Comments
 (0)