2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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 #include "kernels/Logistic.h"
18 #include "kernels/TestUtils.h"
20 namespace luci_interpreter
27 using namespace testing;
29 TEST(LogisticTest, Float)
31 Shape input_shape{1, 2, 4, 1};
32 std::vector<float> input_data{
36 Tensor input_tensor = makeInputTensor<DataType::FLOAT32>(input_shape, input_data);
37 Tensor output_tensor = makeOutputTensor(DataType::FLOAT32);
39 Logistic kernel(&input_tensor, &output_tensor);
43 std::vector<float> ref_output_data{
44 0.5, 0.002473, 0.880797, 0.982014, //
45 0.952574, 0.119203, 0.999955, 0.731059, //
47 EXPECT_THAT(extractTensorData<float>(output_tensor),
48 ElementsAreArray(ArrayFloatNear(ref_output_data)));
49 // TODO make a Shape checking of output_tensor.
53 // Need to Implement GetDequantizedOutput Function.
56 } // namespace kernels
57 } // namespace luci_interpreter