Imported Upstream version 1.4.0
[platform/core/ml/nnfw.git] / runtime / contrib / pure_arm_compute / src / internal / op / Unpack.cc
1 /*
2  * Copyright (c) 2018 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 #include "internal/op/Unpack.h"
18 #include "internal/op/NodeVisitor.h"
19
20 #include <cassert>
21
22 namespace internal
23 {
24 namespace tflite
25 {
26 namespace op
27 {
28 namespace Unpack
29 {
30
31 void Node::accept(NodeVisitor &&v) const { v.visit(*this); }
32
33 } // namespace Unpack
34 } // namespace op
35 } // namespace tflite
36 } // namespace internal
37
38 namespace internal
39 {
40 namespace tflite
41 {
42 namespace op
43 {
44 namespace Unpack
45 {
46 // There are three inputs: tensor which is to be unpacked,
47 // axis along which tensor needs to be unpacked
48 // and number of splits along the axis.
49
50 Param::Param(uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount,
51              const uint32_t *outputs)
52 {
53   assert(inputCount == 3);
54
55   ifm_index = inputs[0];
56
57   for (uint32_t n = 0; n < outputCount; ++n)
58   {
59     ofm_indexes.emplace_back(outputs[n]);
60   }
61   num_split_index = inputs[1];
62   axis_index = inputs[2];
63 }
64
65 } // namespace Unpack
66 } // namespace op
67 } // namespace tflite
68 } // namespace internal