Imported Upstream version 1.4.0
[platform/core/ml/nnfw.git] / runtime / contrib / pure_arm_compute / src / internal / op / Softmax.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/Softmax.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 Softmax
29 {
30
31 void Node::accept(NodeVisitor &&v) const { v.visit(*this); }
32
33 } // namespace Softmax
34 } // namespace op
35 } // namespace tflite
36 } // namespace internal
37
38 namespace internal
39 {
40 namespace tflite
41 {
42 namespace op
43 {
44 namespace Softmax
45 {
46
47 Param::Param(uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount,
48              const uint32_t *outputs)
49 {
50   assert(inputCount == 2 && outputCount == 1);
51
52   output_index = outputs[0];
53
54   // Each input should be interpreted as follows:
55   //
56   //  0 -> A 2-D or 4-D tensor, specifying the tensor to be reshaped.
57   //  1 ->  FLOAT32 value, specifying the positive scaling factor for the exponent, beta.
58   input_index = inputs[0];
59   scale_index = inputs[1];
60 }
61
62 } // namespace Softmax
63 } // namespace op
64 } // namespace tflite
65 } // namespace internal