This patch adds the Gtest file for RSQRT_EX.
Signed-off-by: Tanuj Tekriwal <tanuj.tekri@samsung.com>
neg_ex_2D_float::examples);
}
+namespace rsqrt_ex_float_1 {
+std::vector<MixedTypedExample> examples = {
+// Generated rsqrt_ex_float_1 test
+#include "generated/examples/rsqrt_ex_float_1.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/rsqrt_ex_float_1.model.cpp"
+} // namespace rsqrt_ex_float_1
+TEST_F(GeneratedTests, rsqrt_ex_float_1) {
+ execute(rsqrt_ex_float_1::CreateModel,
+ rsqrt_ex_float_1::is_ignored,
+ rsqrt_ex_float_1::examples);
+}
+
namespace notequal_ex_float {
std::vector<MixedTypedExample> examples = {
// Generated notequal_ex_float test
--- /dev/null
+// Generated file (from: rsqrt_ex_float_1.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1.0f, 2.0f, 4.0f, 8.0f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1.0f, 0.70710678118f, 0.5f, 0.35355339059f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: rsqrt_ex_float_1.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type0(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
+ // Phase 1, operands
+ auto op1 = model->addOperand(&type0);
+ auto op3 = model->addOperand(&type0);
+ // Phase 2, operations
+ model->addOperationEx(ANEURALNETWORKS_RSQRT_EX, {op1}, {op3});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op1},
+ {op3});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
GeneratedTests.relu*
GeneratedTests.resize_bilinear*
GeneratedTests.rnn*
+GeneratedTests.rsqrt*
GeneratedTests.mean*
GeneratedTests.pad*
GeneratedTests.space_to_depth*
GeneratedTests.notequal*
GeneratedTests.pad
GeneratedTests.pad_float_1
+GeneratedTests.rsqrt_ex_float_1
GeneratedTests.space_to_batch
GeneratedTests.space_to_batch_float_1
GeneratedTests.space_to_batch_float_2
GeneratedTests.relu1_quant8_2
GeneratedTests.rnn
GeneratedTests.rnn_state
+GeneratedTests.rsqrt_ex_float_1
GeneratedTests.space_to_depth_float_1
GeneratedTests.space_to_depth_float_2
GeneratedTests.space_to_depth_float_3
--- /dev/null
+#
+# Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# model
+model = Model()
+
+i1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 1}")
+i3 = Output("op3", "TENSOR_FLOAT32", "{1, 2, 2, 1}")
+model = model.Operation("RSQRT_EX", i1).To(i3)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+ [1.0, 2.0, 4.0, 8.0]}
+
+output0 = {i3: # output 0
+ [1.0,
+ 0.70710678118,
+ 0.5,
+ 0.35355339059]}
+
+# Instantiate an example
+Example((input0, output0))