ONE - On-device Neural Engine
Loading...
Searching...
No Matches
FloatUnpackKernel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef LUCI_INTERPRETER_TEST_MODELS_FLOAT_UNPACK_KERNEL_H
18#define LUCI_INTERPRETER_TEST_MODELS_FLOAT_UNPACK_KERNEL_H
19
20#include "TestDataUnpackBase.h"
21
22namespace luci_interpreter
23{
24namespace test_kernel
25{
26namespace unpack_float
27{
28/*
29 * Unpack Kernel:
30 *
31 * Input(2, 2, 3, 4)
32 * |
33 * Unpack(num=2, axis=0)
34 * / \
35 * Output1(2, 3, 4) Output1(2, 3, 4)
36 */
37const unsigned char test_kernel_model_circle[] = {
38 0x18, 0x00, 0x00, 0x00, 0x43, 0x49, 0x52, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00,
39 0x0c, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
40 0x34, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
41 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
42 0xf4, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x04, 0x00,
43 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00,
44 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00,
45 0x14, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
46 0x74, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
47 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x16, 0x00, 0x00, 0x00,
48 0x10, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
49 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
50 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
51 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
54 0x04, 0x00, 0x00, 0x00, 0xac, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
55 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6f, 0x66, 0x6d, 0x3a, 0x31, 0x00, 0x00, 0x00,
56 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
57 0xd8, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
58 0x03, 0x00, 0x00, 0x00, 0x6f, 0x66, 0x6d, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
59 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
60 0x08, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
61 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x69, 0x66, 0x6d, 0x00, 0x04, 0x00, 0x00, 0x00,
62 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
63 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x00, 0x00,
64 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58,
65 0x11, 0x00, 0x00, 0x00, 0x4f, 0x4e, 0x45, 0x2d, 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x32, 0x63,
66 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, 0x00};
67
68const std::vector<float> input_data = {
69 80.8925, -4.4767537, 38.051624, 69.14668, -23.124884, -8.138234, 79.53351, 40.877926,
70 -12.0593405, 41.621094, 69.482895, 7.9741273, 3.7500796, -80.87057, 10.576268, -16.321995,
71 -12.388415, -20.782156, 47.479202, -56.73159, 81.99104, 70.61185, 32.652695, -93.72114,
72 -75.67862, -70.78546, -42.199966, -12.66376, 21.785488, -7.168219, -19.772392, -17.600962,
73 64.1301, -4.7490916, 76.81972, -41.70657, -83.13318, 45.003937, 85.05216, -29.184652,
74 40.685417, -35.482887, -60.648735, -0.268777, -0.59301615, -19.212725, 87.67197, -37.269848};
75const std::vector<float> reference_output_data_1 = {
76 80.8925, -4.4767537, 38.051624, 69.14668, -23.124884, -8.138234, 79.53351, 40.877926,
77 -12.0593405, 41.621094, 69.482895, 7.9741273, 3.7500796, -80.87057, 10.576268, -16.321995,
78 -12.388415, -20.782156, 47.479202, -56.73159, 81.99104, 70.61185, 32.652695, -93.72114};
79const std::vector<float> reference_output_data_2 = {
80 -75.67862, -70.78546, -42.199966, -12.66376, 21.785488, -7.168219, -19.772392, -17.600962,
81 64.1301, -4.7490916, 76.81972, -41.70657, -83.13318, 45.003937, 85.05216, -29.184652,
82 40.685417, -35.482887, -60.648735, -0.268777, -0.59301615, -19.212725, 87.67197, -37.269848};
83
84} // namespace unpack_float
85
99
100} // namespace test_kernel
101} // namespace luci_interpreter
102
103#endif // LUCI_INTERPRETER_TEST_MODELS_FLOAT_UNPACK_KERNEL_H
const std::vector< float > reference_output_data_2
const std::vector< float > reference_output_data_1