mobilenet_quantized::examples);
}
+namespace mul_4D_nnfw {
+std::vector<MixedTypedExample> examples = {
+// Generated mul_4D_nnfw test
+#include "generated/examples/mul_4D_nnfw.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/mul_4D_nnfw.model.cpp"
+} // namespace mul_4D_nnfw
+TEST_F(GeneratedTests, mul_4D_nnfw) {
+ execute(mul_4D_nnfw::CreateModel,
+ mul_4D_nnfw::is_ignored,
+ mul_4D_nnfw::examples);
+}
+
namespace mul_broadcast_3D_1D_1_nnfw {
std::vector<MixedTypedExample> examples = {
// Generated mul_broadcast_3D_1D_1_nnfw test
--- /dev/null
+// Generated file (from: mul_4D_nnfw.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1, 2, -3, -4, -15, 6, 23, 8, -1, -2, 3, 4, 10, -6, 7, -2}}, {1, {-1, -2, 3, 4, -5, -6, 7, -8, 1, -2, -3, -4, -5, 6, 7, 8}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {-1, -4, -9, -16, 75, -36, 161, -64, -1, 4, -9, -16, -50, -36, 49, -16}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: mul_4D_nnfw.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type1(Type::INT32, {});
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 2});
+ // Phase 1, operands
+ auto op1 = model->addOperand(&type0);
+ auto op2 = model->addOperand(&type0);
+ auto act = model->addOperand(&type1);
+ auto op3 = model->addOperand(&type0);
+ // Phase 2, operations
+ static int32_t act_init[] = {0};
+ model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
+ model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op1, op2},
+ {op3});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
--- /dev/null
+# model
+model = Model()
+i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2, 2}")
+i2 = Input("op2", "TENSOR_FLOAT32", "{2, 2, 2, 2}")
+act = Int32Scalar("act", 0) # an int32_t scalar fuse_activation
+i3 = Output("op3", "TENSOR_FLOAT32", "{2, 2, 2, 2}")
+model = model.Operation("MUL", i1, i2, act).To(i3)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+ [1, 2, -3, -4, -15, 6, 23, 8, -1, -2, 3, 4, 10, -6, 7, -2],
+ i2: # input 1
+ [-1, -2, 3, 4, -5, -6, 7, -8, 1, -2, -3, -4, -5, 6, 7, 8]}
+
+output0 = {i3: # output 0
+ [-1, -4, -9, -16, 75, -36, 161, -64, -1, 4, -9, -16, -50, -36, 49, -16]}
+
+# Instantiate an example
+Example((input0, output0))