Regenerate tests with the recent changes
This change is just a regeneration of existing tests to fix the
following issues:
* Abs tests didn't contain changes ag/5528866 and ag/5610839
* ROI_POOLING missed vts model
Test: NeuralNetworksTest_static
Change-Id: Id99b6af62a3e24b74863eee5cbe100b3f58aa5c3
Merged-In: Id99b6af62a3e24b74863eee5cbe100b3f58aa5c3
(cherry picked from commit ec3b2e9a8bf0dc0a3625c8f0c312878e40da2677)
diff --git a/nn/runtime/test/generated/all_generated_V1_2_vts_tests.cpp b/nn/runtime/test/generated/all_generated_V1_2_vts_tests.cpp
index 15f5b34..08a8028 100644
--- a/nn/runtime/test/generated/all_generated_V1_2_vts_tests.cpp
+++ b/nn/runtime/test/generated/all_generated_V1_2_vts_tests.cpp
@@ -11956,6 +11956,194 @@
}
+// Generated from: roi_pooling.mod.py.
+namespace roi_pooling {
+// Generated roi_pooling test
+#include "examples/roi_pooling.example.cpp"
+// Generated model constructor
+#include "vts_models/roi_pooling.model.cpp"
+} // namespace roi_pooling
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc,
+ roi_pooling::is_ignored_nhwc,
+ roi_pooling::get_examples_nhwc());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc) {
+ const Model model = roi_pooling::createTestModel_nhwc();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc_relaxed) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc_relaxed,
+ roi_pooling::is_ignored_nhwc_relaxed,
+ roi_pooling::get_examples_nhwc_relaxed());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc_relaxed) {
+ const Model model = roi_pooling::createTestModel_nhwc_relaxed();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc_relaxed());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc_quant8) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc_quant8,
+ roi_pooling::is_ignored_nhwc_quant8,
+ roi_pooling::get_examples_nhwc_quant8());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc_quant8) {
+ const Model model = roi_pooling::createTestModel_nhwc_quant8();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc_quant8());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw,
+ roi_pooling::is_ignored_nchw,
+ roi_pooling::get_examples_nchw());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw) {
+ const Model model = roi_pooling::createTestModel_nchw();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw_relaxed) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw_relaxed,
+ roi_pooling::is_ignored_nchw_relaxed,
+ roi_pooling::get_examples_nchw_relaxed());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw_relaxed) {
+ const Model model = roi_pooling::createTestModel_nchw_relaxed();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw_relaxed());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw_quant8) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw_quant8,
+ roi_pooling::is_ignored_nchw_quant8,
+ roi_pooling::get_examples_nchw_quant8());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw_quant8) {
+ const Model model = roi_pooling::createTestModel_nchw_quant8();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw_quant8());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc_2,
+ roi_pooling::is_ignored_nhwc_2,
+ roi_pooling::get_examples_nhwc_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc_2) {
+ const Model model = roi_pooling::createTestModel_nhwc_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc_relaxed_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc_relaxed_2,
+ roi_pooling::is_ignored_nhwc_relaxed_2,
+ roi_pooling::get_examples_nhwc_relaxed_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc_relaxed_2) {
+ const Model model = roi_pooling::createTestModel_nhwc_relaxed_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc_relaxed_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nhwc_quant8_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nhwc_quant8_2,
+ roi_pooling::is_ignored_nhwc_quant8_2,
+ roi_pooling::get_examples_nhwc_quant8_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nhwc_quant8_2) {
+ const Model model = roi_pooling::createTestModel_nhwc_quant8_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nhwc_quant8_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw_2,
+ roi_pooling::is_ignored_nchw_2,
+ roi_pooling::get_examples_nchw_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw_2) {
+ const Model model = roi_pooling::createTestModel_nchw_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw_relaxed_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw_relaxed_2,
+ roi_pooling::is_ignored_nchw_relaxed_2,
+ roi_pooling::get_examples_nchw_relaxed_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw_relaxed_2) {
+ const Model model = roi_pooling::createTestModel_nchw_relaxed_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw_relaxed_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
+TEST_F(NeuralnetworksHidlTest, roi_pooling_nchw_quant8_2) {
+ generated_tests::Execute(device,
+ roi_pooling::createTestModel_nchw_quant8_2,
+ roi_pooling::is_ignored_nchw_quant8_2,
+ roi_pooling::get_examples_nchw_quant8_2());
+}
+
+TEST_F(ValidationTest, roi_pooling_nchw_quant8_2) {
+ const Model model = roi_pooling::createTestModel_nchw_quant8_2();
+ const std::vector<Request> requests = createRequests(roi_pooling::get_examples_nchw_quant8_2());
+ validateModel(model);
+ validateRequests(model, requests);
+}
+
+
// Generated from: rotated_bbox_transform.mod.py.
namespace rotated_bbox_transform {
// Generated rotated_bbox_transform test
diff --git a/nn/runtime/test/generated/examples/roi_pooling.example.cpp b/nn/runtime/test/generated/examples/roi_pooling.example.cpp
index 3e30d1e..295d49b 100644
--- a/nn/runtime/test/generated/examples/roi_pooling.example.cpp
+++ b/nn/runtime/test/generated/examples/roi_pooling.example.cpp
@@ -1,6 +1,7 @@
// clang-format off
// Generated file (from: roi_pooling.mod.py). Do not edit
-std::vector<MixedTypedExample> examples_nhwc = {
+std::vector<MixedTypedExample>& get_examples_nhwc() {
+static std::vector<MixedTypedExample> examples_nhwc = {
// Begin of an example
{
.operands = {
@@ -33,8 +34,11 @@
},
}, // End of an example
};
+return examples_nhwc;
+};
-std::vector<MixedTypedExample> examples_nhwc_relaxed = {
+std::vector<MixedTypedExample>& get_examples_nhwc_relaxed() {
+static std::vector<MixedTypedExample> examples_nhwc_relaxed = {
// Begin of an example
{
.operands = {
@@ -67,8 +71,11 @@
},
}, // End of an example
};
+return examples_nhwc_relaxed;
+};
-std::vector<MixedTypedExample> examples_nhwc_quant8 = {
+std::vector<MixedTypedExample>& get_examples_nhwc_quant8() {
+static std::vector<MixedTypedExample> examples_nhwc_quant8 = {
// Begin of an example
{
.operands = {
@@ -101,8 +108,11 @@
},
}, // End of an example
};
+return examples_nhwc_quant8;
+};
-std::vector<MixedTypedExample> examples_nchw = {
+std::vector<MixedTypedExample>& get_examples_nchw() {
+static std::vector<MixedTypedExample> examples_nchw = {
// Begin of an example
{
.operands = {
@@ -135,8 +145,11 @@
},
}, // End of an example
};
+return examples_nchw;
+};
-std::vector<MixedTypedExample> examples_nchw_relaxed = {
+std::vector<MixedTypedExample>& get_examples_nchw_relaxed() {
+static std::vector<MixedTypedExample> examples_nchw_relaxed = {
// Begin of an example
{
.operands = {
@@ -169,8 +182,11 @@
},
}, // End of an example
};
+return examples_nchw_relaxed;
+};
-std::vector<MixedTypedExample> examples_nchw_quant8 = {
+std::vector<MixedTypedExample>& get_examples_nchw_quant8() {
+static std::vector<MixedTypedExample> examples_nchw_quant8 = {
// Begin of an example
{
.operands = {
@@ -203,8 +219,11 @@
},
}, // End of an example
};
+return examples_nchw_quant8;
+};
-std::vector<MixedTypedExample> examples_nhwc_2 = {
+std::vector<MixedTypedExample>& get_examples_nhwc_2() {
+static std::vector<MixedTypedExample> examples_nhwc_2 = {
// Begin of an example
{
.operands = {
@@ -237,8 +256,11 @@
},
}, // End of an example
};
+return examples_nhwc_2;
+};
-std::vector<MixedTypedExample> examples_nhwc_relaxed_2 = {
+std::vector<MixedTypedExample>& get_examples_nhwc_relaxed_2() {
+static std::vector<MixedTypedExample> examples_nhwc_relaxed_2 = {
// Begin of an example
{
.operands = {
@@ -271,8 +293,11 @@
},
}, // End of an example
};
+return examples_nhwc_relaxed_2;
+};
-std::vector<MixedTypedExample> examples_nhwc_quant8_2 = {
+std::vector<MixedTypedExample>& get_examples_nhwc_quant8_2() {
+static std::vector<MixedTypedExample> examples_nhwc_quant8_2 = {
// Begin of an example
{
.operands = {
@@ -305,8 +330,11 @@
},
}, // End of an example
};
+return examples_nhwc_quant8_2;
+};
-std::vector<MixedTypedExample> examples_nchw_2 = {
+std::vector<MixedTypedExample>& get_examples_nchw_2() {
+static std::vector<MixedTypedExample> examples_nchw_2 = {
// Begin of an example
{
.operands = {
@@ -339,8 +367,11 @@
},
}, // End of an example
};
+return examples_nchw_2;
+};
-std::vector<MixedTypedExample> examples_nchw_relaxed_2 = {
+std::vector<MixedTypedExample>& get_examples_nchw_relaxed_2() {
+static std::vector<MixedTypedExample> examples_nchw_relaxed_2 = {
// Begin of an example
{
.operands = {
@@ -373,8 +404,11 @@
},
}, // End of an example
};
+return examples_nchw_relaxed_2;
+};
-std::vector<MixedTypedExample> examples_nchw_quant8_2 = {
+std::vector<MixedTypedExample>& get_examples_nchw_quant8_2() {
+static std::vector<MixedTypedExample> examples_nchw_quant8_2 = {
// Begin of an example
{
.operands = {
@@ -407,4 +441,6 @@
},
}, // End of an example
};
+return examples_nchw_quant8_2;
+};
diff --git a/nn/runtime/test/generated/tests/roi_pooling.mod.py.cpp b/nn/runtime/test/generated/tests/roi_pooling.mod.py.cpp
index 98ebb53..923e9ea 100644
--- a/nn/runtime/test/generated/tests/roi_pooling.mod.py.cpp
+++ b/nn/runtime/test/generated/tests/roi_pooling.mod.py.cpp
@@ -12,72 +12,72 @@
TEST_F(GeneratedTests, roi_pooling_nhwc) {
execute(roi_pooling::CreateModel_nhwc,
roi_pooling::is_ignored_nhwc,
- roi_pooling::examples_nhwc);
+ roi_pooling::get_examples_nhwc());
}
TEST_F(GeneratedTests, roi_pooling_nhwc_relaxed) {
execute(roi_pooling::CreateModel_nhwc_relaxed,
roi_pooling::is_ignored_nhwc_relaxed,
- roi_pooling::examples_nhwc_relaxed);
+ roi_pooling::get_examples_nhwc_relaxed());
}
TEST_F(GeneratedTests, roi_pooling_nhwc_quant8) {
execute(roi_pooling::CreateModel_nhwc_quant8,
roi_pooling::is_ignored_nhwc_quant8,
- roi_pooling::examples_nhwc_quant8);
+ roi_pooling::get_examples_nhwc_quant8());
}
TEST_F(GeneratedTests, roi_pooling_nchw) {
execute(roi_pooling::CreateModel_nchw,
roi_pooling::is_ignored_nchw,
- roi_pooling::examples_nchw);
+ roi_pooling::get_examples_nchw());
}
TEST_F(GeneratedTests, roi_pooling_nchw_relaxed) {
execute(roi_pooling::CreateModel_nchw_relaxed,
roi_pooling::is_ignored_nchw_relaxed,
- roi_pooling::examples_nchw_relaxed);
+ roi_pooling::get_examples_nchw_relaxed());
}
TEST_F(GeneratedTests, roi_pooling_nchw_quant8) {
execute(roi_pooling::CreateModel_nchw_quant8,
roi_pooling::is_ignored_nchw_quant8,
- roi_pooling::examples_nchw_quant8);
+ roi_pooling::get_examples_nchw_quant8());
}
TEST_F(GeneratedTests, roi_pooling_nhwc_2) {
execute(roi_pooling::CreateModel_nhwc_2,
roi_pooling::is_ignored_nhwc_2,
- roi_pooling::examples_nhwc_2);
+ roi_pooling::get_examples_nhwc_2());
}
TEST_F(GeneratedTests, roi_pooling_nhwc_relaxed_2) {
execute(roi_pooling::CreateModel_nhwc_relaxed_2,
roi_pooling::is_ignored_nhwc_relaxed_2,
- roi_pooling::examples_nhwc_relaxed_2);
+ roi_pooling::get_examples_nhwc_relaxed_2());
}
TEST_F(GeneratedTests, roi_pooling_nhwc_quant8_2) {
execute(roi_pooling::CreateModel_nhwc_quant8_2,
roi_pooling::is_ignored_nhwc_quant8_2,
- roi_pooling::examples_nhwc_quant8_2);
+ roi_pooling::get_examples_nhwc_quant8_2());
}
TEST_F(GeneratedTests, roi_pooling_nchw_2) {
execute(roi_pooling::CreateModel_nchw_2,
roi_pooling::is_ignored_nchw_2,
- roi_pooling::examples_nchw_2);
+ roi_pooling::get_examples_nchw_2());
}
TEST_F(GeneratedTests, roi_pooling_nchw_relaxed_2) {
execute(roi_pooling::CreateModel_nchw_relaxed_2,
roi_pooling::is_ignored_nchw_relaxed_2,
- roi_pooling::examples_nchw_relaxed_2);
+ roi_pooling::get_examples_nchw_relaxed_2());
}
TEST_F(GeneratedTests, roi_pooling_nchw_quant8_2) {
execute(roi_pooling::CreateModel_nchw_quant8_2,
roi_pooling::is_ignored_nchw_quant8_2,
- roi_pooling::examples_nchw_quant8_2);
+ roi_pooling::get_examples_nchw_quant8_2());
}
diff --git a/nn/runtime/test/generated/vts_models/roi_pooling.model.cpp b/nn/runtime/test/generated/vts_models/roi_pooling.model.cpp
new file mode 100644
index 0000000..cec26cc
--- /dev/null
+++ b/nn/runtime/test/generated/vts_models/roi_pooling.model.cpp
@@ -0,0 +1,1074 @@
+// clang-format off
+// Generated file (from: roi_pooling.mod.py). Do not edit
+// Create the model
+Model createTestModel_nhwc() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {1, 4, 4, 1},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 2, 1},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nhwc(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nhwc_relaxed() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {1, 4, 4, 1},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 2, 1},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ .relaxComputationFloat32toFloat16 = true,
+ };
+}
+
+inline bool is_ignored_nhwc_relaxed(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nhwc_quant8() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {1, 4, 4, 1},
+ .numberOfConsumers = 1,
+ .scale = 0.25f,
+ .zeroPoint = 128,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {4, 2, 2, 1},
+ .numberOfConsumers = 0,
+ .scale = 0.25f,
+ .zeroPoint = 128,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nhwc_quant8(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {1, 1, 4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 1, 2, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nchw(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw_relaxed() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {1, 1, 4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 1, 2, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ .relaxComputationFloat32toFloat16 = true,
+ };
+}
+
+inline bool is_ignored_nchw_relaxed(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw_quant8() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {1, 1, 4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.25f,
+ .zeroPoint = 128,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 4},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {4, 1, 2, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.25f,
+ .zeroPoint = 128,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 63, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nchw_quant8(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nhwc_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {2, 4, 8, 2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 3, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nhwc_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nhwc_relaxed_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {2, 4, 8, 2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 3, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ .relaxComputationFloat32toFloat16 = true,
+ };
+}
+
+inline bool is_ignored_nhwc_relaxed_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nhwc_quant8_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {2, 4, 8, 2},
+ .numberOfConsumers = 1,
+ .scale = 0.04f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {4, 2, 3, 2},
+ .numberOfConsumers = 0,
+ .scale = 0.04f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 0
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nhwc_quant8_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {2, 2, 4, 8},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 2, 3},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nchw_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw_relaxed_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {2, 2, 4, 8},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 2, 2, 3},
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ .relaxComputationFloat32toFloat16 = true,
+ };
+}
+
+inline bool is_ignored_nchw_relaxed_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+
+// Create the model
+Model createTestModel_nchw_quant8_2() {
+ const std::vector<Operand> operands = {
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {2, 2, 4, 8},
+ .numberOfConsumers = 1,
+ .scale = 0.04f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_FLOAT32,
+ .dimensions = {4, 5},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_INPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ },
+ {
+ .type = OperandType::TENSOR_INT32,
+ .dimensions = {2},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 0, .length = 8},
+ },
+ {
+ .type = OperandType::FLOAT32,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 8, .length = 4},
+ },
+ {
+ .type = OperandType::BOOL,
+ .dimensions = {},
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::CONSTANT_COPY,
+ .location = {.poolIndex = 0, .offset = 12, .length = 1},
+ },
+ {
+ .type = OperandType::TENSOR_QUANT8_ASYMM,
+ .dimensions = {4, 2, 2, 3},
+ .numberOfConsumers = 0,
+ .scale = 0.04f,
+ .zeroPoint = 0,
+ .lifetime = OperandLifeTime::MODEL_OUTPUT,
+ .location = {.poolIndex = 0, .offset = 0, .length = 0},
+ }
+ };
+
+ const std::vector<Operation> operations = {
+ {
+ .type = OperationType::ROI_POOLING,
+ .inputs = {0, 1, 2, 3, 4},
+ .outputs = {5},
+ }
+ };
+
+ const std::vector<uint32_t> inputIndexes = {0, 1};
+ const std::vector<uint32_t> outputIndexes = {5};
+ std::vector<uint8_t> operandValues = {
+ 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 128, 62, 1
+ };
+ const std::vector<hidl_memory> pools = {};
+
+ return {
+ .operands = operands,
+ .operations = operations,
+ .inputIndexes = inputIndexes,
+ .outputIndexes = outputIndexes,
+ .operandValues = operandValues,
+ .pools = pools,
+ };
+}
+
+inline bool is_ignored_nchw_quant8_2(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
+