Skip to content

Commit c11b2ee

Browse files
committed
Unit tests
1 parent d1da44f commit c11b2ee

38 files changed

Lines changed: 667 additions & 2 deletions

Tests/UnitTest/RefactoredTestGen/test_plan.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,14 @@
542542
"input_size" : 22,
543543
"hidden_size" : 3,
544544
"json_template": "lstm_s16.json"
545+
},
546+
{"name" : "lstm_stateful_batch_major_multibatch_s16",
547+
"time_major" : false,
548+
"batch_size" : 2,
549+
"time_steps" : 2,
550+
"input_size" : 6,
551+
"hidden_size" : 7,
552+
"json_template": "lstm_s16.json"
545553
}
546554
]
547555
},
@@ -574,6 +582,13 @@
574582
"time_steps" : 1,
575583
"input_size" : 22,
576584
"hidden_size" : 3
585+
},
586+
{"name" : "lstm_stateful_batch_major_multibatch",
587+
"time_major" : false,
588+
"batch_size" : 2,
589+
"time_steps" : 2,
590+
"input_size" : 6,
591+
"hidden_size" : 7
577592
}
578593
]
579594
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int32_t lstm_stateful_batch_major_multibatch_cell_gate_bias[7] = {0, 0, 0, 0, 0, 0, 0};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int8_t lstm_stateful_batch_major_multibatch_cell_gate_hidden_weights[49] = {
7+
-20, -88, 87, 87, 109, -54, -12, 21, 2, -112, 44, -79, -97, -15, 123, 105, -122,
8+
-29, -83, 36, 58, 33, 59, -115, 127, -106, 101, -57, -97, -64, -39, 71, 4, -114,
9+
-94, 74, 34, -12, -118, -64, 104, 102, -36, -114, 117, 95, -1, 67, 81};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int8_t lstm_stateful_batch_major_multibatch_cell_gate_input_weights[42] = {
7+
92, 100, -29, 127, 76, -74, 115, -81, 63, 4, 69, -81, 8, -25, 42, 99, 44, 101, 12, -25, 99,
8+
-70, -88, -41, 107, 65, 67, -31, 87, -54, -104, 95, 35, 21, 125, -87, 27, 78, -113, -114, 61, -101};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
5+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_TIME_MAJOR false
6+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_BATCH_SIZE 2
7+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_TIME_STEPS 2
8+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_SIZE 6
9+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_HIDDEN_SIZE 7
10+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_SCALE_POWER -15
11+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_ZERO_POINT 128
12+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_ZERO_POINT 4
13+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_CLIP 32767
14+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_TO_CELL_MULTIPLIER 1073741824
15+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_TO_CELL_SHIFT -14
16+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_TO_CELL_MULTIPLIER 1073741824
17+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_TO_CELL_SHIFT -14
18+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_MULTIPLIER 1993694592
19+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_SHIFT -21
20+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_GATE_HIDDEN_MULTIPLIER 1143723136
21+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_GATE_HIDDEN_SHIFT -3
22+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_GATE_HIDDEN_MULTIPLIER 1164696448
23+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_GATE_HIDDEN_SHIFT -3
24+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_GATE_HIDDEN_MULTIPLIER 1134438656
25+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_GATE_HIDDEN_SHIFT -3
26+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_GATE_HIDDEN_MULTIPLIER 2044599040
27+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_GATE_HIDDEN_SHIFT -4
28+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_GATE_INPUT_MULTIPLIER 2130456576
29+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_OUTPUT_GATE_INPUT_SHIFT -3
30+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_GATE_INPUT_MULTIPLIER 2096726656
31+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_CELL_GATE_INPUT_SHIFT -3
32+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_GATE_INPUT_MULTIPLIER 2025295488
33+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_FORGET_GATE_INPUT_SHIFT -3
34+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_GATE_INPUT_MULTIPLIER 2146124928
35+
#define LSTM_STATEFUL_BATCH_MAJOR_MULTIBATCH_INPUT_GATE_INPUT_SHIFT -3
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int32_t lstm_stateful_batch_major_multibatch_forget_gate_bias[7] = {0, 0, 0, 0, 0, 0, 0};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int8_t lstm_stateful_batch_major_multibatch_forget_gate_hidden_weights[49] = {
7+
8, -96, 106, 66, -101, 22, -70, 86, -37, -1, -127, 52, 9, 79, 111, -94, 126,
8+
-21, -25, -79, 42, -57, -42, -3, 126, 51, -49, -28, -10, 50, -104, -48, -11, -78,
9+
36, 121, 6, -56, -24, -75, -104, -103, -119, -63, -69, -51, 11, -43, 19};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int8_t lstm_stateful_batch_major_multibatch_forget_gate_input_weights[42] = {
7+
58, -87, 92, 94, -41, -61, 31, -86, 72, 3, 116, 68, -81, -55, -44, -122, -105, -87, -23, 94, -113,
8+
-68, 23, 45, -96, 13, 103, -116, 87, 88, -2, 6, 58, -126, 33, 28, -113, 68, -30, -84, 127, -33};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int32_t lstm_stateful_batch_major_multibatch_input_gate_bias[7] = {0, 0, 0, 0, 0, 0, 0};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Generated by generate_test_data.py using tensorflow version 2.18.0 (Keras version 3.14.1).
2+
// Interpreter from tflite_micro runtime version 0.dev20260203175027-g88f8587.
3+
#pragma once
4+
#include <stdint.h>
5+
6+
const int8_t lstm_stateful_batch_major_multibatch_input_gate_hidden_weights[49] = {
7+
-120, -121, -18, 3, 74, 27, -107, 84, 43, 127, 91, 116, 77, -17, -8, 32, 89,
8+
111, 85, -8, 9, -115, -36, 71, 70, -10, 70, -106, -9, -71, -83, -79, -73, -88,
9+
39, -124, -1, -2, 108, 117, -27, 61, -90, -32, -105, 97, 41, -98, 57};

0 commit comments

Comments
 (0)