Skip to content

Commit e387f58

Browse files
committed
Fixed formatting to match required style
1 parent 5dde9b7 commit e387f58

File tree

5 files changed

+100
-110
lines changed

5 files changed

+100
-110
lines changed

tensorflow/lite/experimental/micro/examples/micro_speech/CMSIS/hanning.cc

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,47 @@ limitations under the License.
1717

1818
const int g_hanning_size = 480;
1919
const int16_t g_hanning[480] = {
20-
0, 1, 5, 12, 22, 35, 50, 69, 90, 114,
21-
140, 170, 202, 237, 275, 316, 359, 405, 454, 506,
22-
560, 617, 677, 740, 805, 873, 943, 1016, 1092, 1171,
23-
1252, 1336, 1422, 1511, 1602, 1696, 1793, 1892, 1993, 2097,
24-
2204, 2312, 2424, 2537, 2653, 2772, 2893, 3016, 3141, 3269,
25-
3399, 3531, 3665, 3802, 3941, 4082, 4225, 4370, 4517, 4666,
26-
4817, 4971, 5126, 5283, 5442, 5603, 5765, 5930, 6096, 6265,
27-
6435, 6606, 6779, 6954, 7131, 7309, 7489, 7670, 7853, 8037,
28-
8223, 8410, 8598, 8788, 8979, 9171, 9365, 9560, 9756, 9953,
29-
10151, 10350, 10551, 10752, 10954, 11157, 11362, 11567, 11772, 11979,
30-
12186, 12395, 12603, 12813, 13023, 13233, 13445, 13656, 13868, 14081,
31-
14294, 14507, 14721, 14935, 15149, 15363, 15578, 15793, 16008, 16222,
32-
16437, 16652, 16867, 17082, 17297, 17511, 17725, 17939, 18153, 18367,
33-
18580, 18793, 19005, 19217, 19428, 19639, 19850, 20059, 20269, 20477,
34-
20685, 20892, 21098, 21303, 21508, 21712, 21914, 22116, 22317, 22517,
35-
22716, 22913, 23110, 23305, 23499, 23692, 23884, 24075, 24264, 24451,
36-
24638, 24823, 25006, 25188, 25369, 25548, 25725, 25901, 26075, 26247,
37-
26418, 26587, 26754, 26920, 27083, 27245, 27405, 27563, 27719, 27874,
38-
28026, 28176, 28324, 28470, 28614, 28756, 28896, 29034, 29169, 29303,
39-
29434, 29563, 29689, 29813, 29935, 30055, 30172, 30287, 30400, 30510,
40-
30617, 30723, 30825, 30926, 31023, 31119, 31211, 31301, 31389, 31474,
41-
31556, 31636, 31713, 31788, 31860, 31929, 31996, 32059, 32121, 32179,
42-
32235, 32288, 32338, 32386, 32430, 32472, 32512, 32548, 32582, 32613,
43-
32641, 32666, 32689, 32708, 32725, 32739, 32751, 32759, 32765, 32767,
44-
32767, 32765, 32759, 32751, 32739, 32725, 32708, 32689, 32666, 32641,
45-
32613, 32582, 32548, 32512, 32472, 32430, 32386, 32338, 32288, 32235,
46-
32179, 32121, 32059, 31996, 31929, 31860, 31788, 31713, 31636, 31556,
47-
31474, 31389, 31301, 31211, 31119, 31023, 30926, 30825, 30723, 30617,
48-
30510, 30400, 30287, 30172, 30055, 29935, 29813, 29689, 29563, 29434,
49-
29303, 29169, 29034, 28896, 28756, 28614, 28470, 28324, 28176, 28026,
50-
27874, 27719, 27563, 27405, 27245, 27083, 26920, 26754, 26587, 26418,
51-
26247, 26075, 25901, 25725, 25548, 25369, 25188, 25006, 24823, 24638,
52-
24451, 24264, 24075, 23884, 23692, 23499, 23305, 23110, 22913, 22716,
53-
22517, 22317, 22116, 21914, 21712, 21508, 21303, 21098, 20892, 20685,
54-
20477, 20269, 20059, 19850, 19639, 19428, 19217, 19005, 18793, 18580,
55-
18367, 18153, 17939, 17725, 17511, 17297, 17082, 16867, 16652, 16437,
56-
16222, 16008, 15793, 15578, 15363, 15149, 14935, 14721, 14507, 14294,
57-
14081, 13868, 13656, 13445, 13233, 13023, 12813, 12603, 12395, 12186,
58-
11979, 11772, 11567, 11362, 11157, 10954, 10752, 10551, 10350, 10151,
59-
9953, 9756, 9560, 9365, 9171, 8979, 8788, 8598, 8410, 8223,
60-
8037, 7853, 7670, 7489, 7309, 7131, 6954, 6779, 6606, 6435,
61-
6265, 6096, 5930, 5765, 5603, 5442, 5283, 5126, 4971, 4817,
62-
4666, 4517, 4370, 4225, 4082, 3941, 3802, 3665, 3531, 3399,
63-
3269, 3141, 3016, 2893, 2772, 2653, 2537, 2424, 2312, 2204,
64-
2097, 1993, 1892, 1793, 1696, 1602, 1511, 1422, 1336, 1252,
65-
1171, 1092, 1016, 943, 873, 805, 740, 677, 617, 560,
66-
506, 454, 405, 359, 316, 275, 237, 202, 170, 140,
67-
114, 90, 69, 50, 35, 22, 12, 5, 1, 0};
20+
0, 1, 5, 12, 22, 35, 50, 69, 90, 114, 140,
21+
170, 202, 237, 275, 316, 359, 405, 454, 506, 560, 617,
22+
677, 740, 805, 873, 943, 1016, 1092, 1171, 1252, 1336, 1422,
23+
1511, 1602, 1696, 1793, 1892, 1993, 2097, 2204, 2312, 2424, 2537,
24+
2653, 2772, 2893, 3016, 3141, 3269, 3399, 3531, 3665, 3802, 3941,
25+
4082, 4225, 4370, 4517, 4666, 4817, 4971, 5126, 5283, 5442, 5603,
26+
5765, 5930, 6096, 6265, 6435, 6606, 6779, 6954, 7131, 7309, 7489,
27+
7670, 7853, 8037, 8223, 8410, 8598, 8788, 8979, 9171, 9365, 9560,
28+
9756, 9953, 10151, 10350, 10551, 10752, 10954, 11157, 11362, 11567, 11772,
29+
11979, 12186, 12395, 12603, 12813, 13023, 13233, 13445, 13656, 13868, 14081,
30+
14294, 14507, 14721, 14935, 15149, 15363, 15578, 15793, 16008, 16222, 16437,
31+
16652, 16867, 17082, 17297, 17511, 17725, 17939, 18153, 18367, 18580, 18793,
32+
19005, 19217, 19428, 19639, 19850, 20059, 20269, 20477, 20685, 20892, 21098,
33+
21303, 21508, 21712, 21914, 22116, 22317, 22517, 22716, 22913, 23110, 23305,
34+
23499, 23692, 23884, 24075, 24264, 24451, 24638, 24823, 25006, 25188, 25369,
35+
25548, 25725, 25901, 26075, 26247, 26418, 26587, 26754, 26920, 27083, 27245,
36+
27405, 27563, 27719, 27874, 28026, 28176, 28324, 28470, 28614, 28756, 28896,
37+
29034, 29169, 29303, 29434, 29563, 29689, 29813, 29935, 30055, 30172, 30287,
38+
30400, 30510, 30617, 30723, 30825, 30926, 31023, 31119, 31211, 31301, 31389,
39+
31474, 31556, 31636, 31713, 31788, 31860, 31929, 31996, 32059, 32121, 32179,
40+
32235, 32288, 32338, 32386, 32430, 32472, 32512, 32548, 32582, 32613, 32641,
41+
32666, 32689, 32708, 32725, 32739, 32751, 32759, 32765, 32767, 32767, 32765,
42+
32759, 32751, 32739, 32725, 32708, 32689, 32666, 32641, 32613, 32582, 32548,
43+
32512, 32472, 32430, 32386, 32338, 32288, 32235, 32179, 32121, 32059, 31996,
44+
31929, 31860, 31788, 31713, 31636, 31556, 31474, 31389, 31301, 31211, 31119,
45+
31023, 30926, 30825, 30723, 30617, 30510, 30400, 30287, 30172, 30055, 29935,
46+
29813, 29689, 29563, 29434, 29303, 29169, 29034, 28896, 28756, 28614, 28470,
47+
28324, 28176, 28026, 27874, 27719, 27563, 27405, 27245, 27083, 26920, 26754,
48+
26587, 26418, 26247, 26075, 25901, 25725, 25548, 25369, 25188, 25006, 24823,
49+
24638, 24451, 24264, 24075, 23884, 23692, 23499, 23305, 23110, 22913, 22716,
50+
22517, 22317, 22116, 21914, 21712, 21508, 21303, 21098, 20892, 20685, 20477,
51+
20269, 20059, 19850, 19639, 19428, 19217, 19005, 18793, 18580, 18367, 18153,
52+
17939, 17725, 17511, 17297, 17082, 16867, 16652, 16437, 16222, 16008, 15793,
53+
15578, 15363, 15149, 14935, 14721, 14507, 14294, 14081, 13868, 13656, 13445,
54+
13233, 13023, 12813, 12603, 12395, 12186, 11979, 11772, 11567, 11362, 11157,
55+
10954, 10752, 10551, 10350, 10151, 9953, 9756, 9560, 9365, 9171, 8979,
56+
8788, 8598, 8410, 8223, 8037, 7853, 7670, 7489, 7309, 7131, 6954,
57+
6779, 6606, 6435, 6265, 6096, 5930, 5765, 5603, 5442, 5283, 5126,
58+
4971, 4817, 4666, 4517, 4370, 4225, 4082, 3941, 3802, 3665, 3531,
59+
3399, 3269, 3141, 3016, 2893, 2772, 2653, 2537, 2424, 2312, 2204,
60+
2097, 1993, 1892, 1793, 1696, 1602, 1511, 1422, 1336, 1252, 1171,
61+
1092, 1016, 943, 873, 805, 740, 677, 617, 560, 506, 454,
62+
405, 359, 316, 275, 237, 202, 170, 140, 114, 90, 69,
63+
50, 35, 22, 12, 5, 1, 0};

tensorflow/lite/experimental/micro/examples/micro_speech/CMSIS/sin_1k.cc

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,47 @@ limitations under the License.
1717

1818
const int g_sin_1k_size = 480;
1919
const int16_t g_sin_1k[480] = {
20-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
21-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
22-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
23-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
24-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
25-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
26-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
27-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
28-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
29-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
30-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
31-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
32-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
33-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
34-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
35-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
36-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
37-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
38-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
39-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
40-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
41-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
42-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
43-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
44-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
45-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
46-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
47-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
48-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
49-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
50-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
51-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
52-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
53-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
54-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
55-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
56-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
57-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
58-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
59-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
60-
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
61-
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
62-
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
63-
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
64-
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
65-
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
66-
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
67-
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253};
20+
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317,
21+
-3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
22+
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0,
23+
1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
24+
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317,
25+
1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
26+
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276,
27+
-3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
28+
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317,
29+
3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
30+
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0,
31+
-1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
32+
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317,
33+
-1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
34+
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276,
35+
3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
36+
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317,
37+
-3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
38+
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0,
39+
1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
40+
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317,
41+
1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
42+
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276,
43+
-3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
44+
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317,
45+
3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
46+
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0,
47+
-1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027,
48+
3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317,
49+
-1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253,
50+
-2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276,
51+
3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253,
52+
0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317,
53+
-3027, -3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027,
54+
2317, 1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0,
55+
1253, 2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027,
56+
-3276, -3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317,
57+
1253, 0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253,
58+
2317, 3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276,
59+
-3027, -2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253,
60+
0, -1253, -2317, -3027, -3276, -3027, -2317, -1253, 0, 1253, 2317,
61+
3027, 3276, 3027, 2317, 1253, 0, -1253, -2317, -3027, -3276, -3027,
62+
-2317, -1253, 0, 1253, 2317, 3027, 3276, 3027, 2317, 1253, 0,
63+
-1253, -2317, -3027, -3276, -3027, -2317, -1253};

tensorflow/lite/experimental/micro/examples/micro_speech/apollo3/pushbutton_test.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
/* This file is a modification of the Tensorflow Micro Lite file micro_speech_test.cc */
16+
/* This file is a modification of the Tensorflow Micro Lite file
17+
* micro_speech_test.cc */
1718

18-
#include "tensorflow/lite/experimental/micro/examples/micro_speech/preprocessor.h"
1919
#include "tensorflow/lite/c/c_api_internal.h"
20-
#include "tensorflow/lite/experimental/micro/micro_error_reporter.h"
21-
#include "tensorflow/lite/experimental/micro/testing/micro_test.h"
20+
#include "tensorflow/lite/experimental/micro/examples/micro_speech/preprocessor.h"
2221
#include "tensorflow/lite/experimental/micro/examples/micro_speech/tiny_conv_model_data.h"
2322
#include "tensorflow/lite/experimental/micro/kernels/all_ops_resolver.h"
23+
#include "tensorflow/lite/experimental/micro/micro_error_reporter.h"
2424
#include "tensorflow/lite/experimental/micro/micro_interpreter.h"
25+
#include "tensorflow/lite/experimental/micro/testing/micro_test.h"
2526
#include "tensorflow/lite/schema/schema_generated.h"
2627
#include "tensorflow/lite/version.h"
2728

@@ -37,12 +38,11 @@ TF_LITE_MICRO_TEST(TestPreprocessor) {
3738
tflite::MicroErrorReporter micro_error_reporter;
3839
tflite::ErrorReporter* error_reporter = &micro_error_reporter;
3940

40-
uint8_t preprocessed_data[43*49];
41-
TfLiteStatus preprocess_1sec_status = Preprocess_1sec(
42-
error_reporter, captured_data, preprocessed_data);
41+
uint8_t preprocessed_data[43 * 49];
42+
TfLiteStatus preprocess_1sec_status =
43+
Preprocess_1sec(error_reporter, captured_data, preprocessed_data);
4344
TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, preprocess_1sec_status);
4445

45-
4646
// Map the model into a usable data structure. This doesn't involve any
4747
// copying or parsing, it's a very lightweight operation.
4848
const tflite::Model* model = ::tflite::GetModel(g_tiny_conv_model_data);
@@ -111,7 +111,6 @@ TF_LITE_MICRO_TEST(TestPreprocessor) {
111111
g_no_score = output->data.uint8[kNoIndex];
112112

113113
error_reporter->Report("Ran successfully\n");
114-
115114
}
116115

117116
TF_LITE_MICRO_TESTS_END

tensorflow/lite/experimental/micro/examples/micro_speech/preprocessor.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ TfLiteStatus Preprocess(tflite::ErrorReporter* error_reporter,
145145
}
146146

147147
TfLiteStatus Preprocess_1sec(tflite::ErrorReporter* error_reporter,
148-
const int16_t* input, uint8_t* output) {
148+
const int16_t* input, uint8_t* output) {
149149
int i;
150-
for(i=0; i<49; i++) {
151-
Preprocess(error_reporter, input+i*320, 480, 43, output+i*43);
150+
for (i = 0; i < 49; i++) {
151+
Preprocess(error_reporter, input + i * 320, 480, 43, output + i * 43);
152152
}
153153
return kTfLiteOk;
154154
}
155-

tensorflow/lite/experimental/micro/examples/micro_speech/preprocessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ TfLiteStatus Preprocess(tflite::ErrorReporter* error_reporter,
2929
uint8_t* output);
3030

3131
TfLiteStatus Preprocess_1sec(tflite::ErrorReporter* error_reporter,
32-
const int16_t* input, uint8_t* output);
32+
const int16_t* input, uint8_t* output);
3333

3434
#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_SPEECH_PREPROCESSOR_H_

0 commit comments

Comments
 (0)