2 # Copyright (C) 2018 The Android Open Source Project
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Derived from tensorflow/lite/kernels/activations_test.cc
19 def test(input0, output0, input_data, beta, axis, output_data):
20 model = Model().Operation("LOG_SOFTMAX", input0, beta, axis).To(output0)
24 }, model=model).AddVariations("relaxed", "float16")
27 input0=Input("input0", "TENSOR_FLOAT32", "{1, 1, 1, 2, 4}"),
28 output0=Output("output0", "TENSOR_FLOAT32", "{1, 1, 1, 2, 4}"),
29 input_data=[0, -6, 2, 4,
33 output_data=[-4.14297, -10.14297, -2.14297, -.142971,
34 -7.00104, -12.00104, -.00104087, -9.00104],
38 input0=Input("input0", "TENSOR_FLOAT32", "{1, 1, 1, 4, 2}"),
39 output0=Output("output0", "TENSOR_FLOAT32", "{1, 1, 1, 4, 2}"),
46 output_data=[-.00247565, -6.00247,
49 -.000123374, -9.00012],
53 input0=Input("input0", "TENSOR_FLOAT32", "{1, 1, 2, 4, 1}"),
54 output0=Output("output0", "TENSOR_FLOAT32", "{1, 1, 2, 4, 1}"),
55 input_data=[0, 2, 3, 10,
59 output_data=[-.00247565, -2.12692, -.00671534, -.000123374,
60 -6.00247, -.126928, -5.00671, -9.00012],
64 input0=Input("input0", "TENSOR_FLOAT32", "{1, 1, 1, 2, 4}"),
65 output0=Output("output0", "TENSOR_FLOAT32", "{1, 1, 1, 2, 4}"),
66 input_data=[0, -.6, .2, .4,
70 output_data=[-4.14297, -10.14297, -2.14297, -.142971,
71 -7.00104, -12.00104, -.00104087, -9.00104],