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 "GenModelTest.h"
19 TEST_F(GenModelTest, OneOp_L2Normalization)
22 int in = cgen.addTensor({{1, 2, 2, 3}, circle::TensorType::TensorType_FLOAT32});
23 int out = cgen.addTensor({{1, 2, 2, 3}, circle::TensorType::TensorType_FLOAT32});
25 cgen.addOperatorL2Normalization({{in}, {out}});
26 cgen.setInputsAndOutputs({in}, {out});
28 _context = std::make_unique<GenModelTestContext>(cgen.finish());
29 _context->addTestCase({{{0, 3, 4, 0, 5, 12, 0, 8, 15, 0, 7, 24}},
30 {{0, 0.6, 0.8, 0, 0.38461539149284363, 0.92307698726654053, 0,
31 0.47058823704719543, 0.88235294818878174, 0, 0.28, 0.96}}});
32 _context->setBackends({"acl_cl", "acl_neon", "cpu"});