Add neg_ex_1D_float for testing 1d tensor.
Add neg_ex_2D_float for testing 2d tensor.
Signed-off-by: prasannar <prasanna.r@samsung.com>
gather_2D_quant8::examples);
}
+namespace neg_ex_1D_float {
+std::vector<MixedTypedExample> examples = {
+// Generated neg_ex_1D_float test
+#include "generated/examples/neg_ex_1D_float.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/neg_ex_1D_float.model.cpp"
+} // namespace neg_ex_1D_float
+TEST_F(GeneratedTests, neg_ex_1D_float) {
+ execute(neg_ex_1D_float::CreateModel,
+ neg_ex_1D_float::is_ignored,
+ neg_ex_1D_float::examples);
+}
+
+namespace neg_ex_2D_float {
+std::vector<MixedTypedExample> examples = {
+// Generated neg_ex_2D_float test
+#include "generated/examples/neg_ex_2D_float.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/neg_ex_2D_float.model.cpp"
+} // namespace neg_ex_2D_float
+TEST_F(GeneratedTests, neg_ex_2D_float) {
+ execute(neg_ex_2D_float::CreateModel,
+ neg_ex_2D_float::is_ignored,
+ neg_ex_2D_float::examples);
+}
+
namespace tensorflowmax_ex_2D_float {
std::vector<MixedTypedExample> examples = {
// Generated tensorflowmax_ex_2D_float test
--- /dev/null
+// Generated file (from: neg_ex_1D_float.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {3.0f, 4.0f, 5.0f, 6.0f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {-3.0f, -4.0f, -5.0f, -6.0f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: neg_ex_2D_float.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {3.123456789123457f, 4.123456789123456f, 5.123456789123456f, 6.123456789123456f, 7.123456789123456f, 8.123456789123457f, 9.123456789123457f, 1.1234567891234568f, 2.123456789123457f, 18.123456789123455f, 19.123456789123455f, 11.123456789123457f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {-3.123456789123457f, -4.123456789123456f, -5.123456789123456f, -6.123456789123456f, -7.123456789123456f, -8.123456789123457f, -9.123456789123457f, -1.1234567891234568f, -2.123456789123457f, -18.123456789123455f, -19.123456789123455f, -11.123456789123457f}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: neg_ex_1D_float.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type0(Type::TENSOR_FLOAT32, {4});
+ // Phase 1, operands
+ auto op1 = model->addOperand(&type0);
+ auto op2 = model->addOperand(&type0);
+ // Phase 2, operations
+ model->addOperationEx(ANEURALNETWORKS_NEG_EX, {op1}, {op2});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op1},
+ {op2});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
--- /dev/null
+// Generated file (from: neg_ex_2D_float.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type0(Type::TENSOR_FLOAT32, {3,4});
+ // Phase 1, operands
+ auto op1 = model->addOperand(&type0);
+ auto op2 = model->addOperand(&type0);
+ // Phase 2, operations
+ model->addOperationEx(ANEURALNETWORKS_NEG_EX, {op1}, {op2});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op1},
+ {op2});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
GeneratedTests.max_pool_quant8_3
GeneratedTests.mobilenet*
GeneratedTests.mul*
+GeneratedTests.neg_ex_1D_float
+GeneratedTests.neg_ex_2D_float
GeneratedTests.relu1*
GeneratedTests.relu6*
GeneratedTests.relu*
GeneratedTests.mean_quant8_1
GeneratedTests.mean_quant8_2
GeneratedTests.mobilenet_quantized
+GeneratedTests.neg_ex_1D_float
+GeneratedTests.neg_ex_2D_float
GeneratedTests.pad
GeneratedTests.pad_float_1
GeneratedTests.space_to_batch
GeneratedTests.lstm
GeneratedTests.lstm_state2
GeneratedTests.lstm_state
+GeneratedTests.neg_ex_1D_float
+GeneratedTests.neg_ex_2D_float
GeneratedTests.relu1_float_1
GeneratedTests.relu1_float_2
GeneratedTests.relu1_quant8_1
--- /dev/null
+# model
+model = Model()
+i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of input
+i2 = Output("op2", "TENSOR_FLOAT32", "{4}") # a vector of output
+model = model.Operation("NEG_EX", i1).To(i2)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+ [3.0, 4.0, 5.0, 6.0]}
+
+output0 = {i2: # output 0
+ [-3.0, -4.0, -5.0, -6.0]}
+
+# Instantiate an example
+Example((input0, output0))
--- /dev/null
+# model
+model = Model()
+i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}")
+i2 = Output("op2", "TENSOR_FLOAT32", "{3,4}")
+model = model.Operation("NEG_EX", i1).To(i2)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+ [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789,
+ 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789,
+ 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]}
+
+output0 = {i2: # output 0
+ [-3.123456789123456789, -4.123456789123456789, -5.123456789123456789, -6.123456789123456789,
+ -7.123456789123456789, -8.123456789123456789, -9.123456789123456789, -1.123456789123456789,
+ -2.123456789123456789, -18.123456789123456789, -19.123456789123456789, -11.123456789123456789]}
+
+# Instantiate an example
+Example((input0, output0))