Add more tests for v1.1 ops
Bug: 63911257
Test: mm
Test: NeuralNetworksTests and VTS tests pass
Change-Id: Ia9674e5bed390fd2507c6c70f1a37737f7733ae9
diff --git a/nn/runtime/test/generated/models/strided_slice_quant8_4.model.cpp b/nn/runtime/test/generated/models/strided_slice_quant8_4.model.cpp
new file mode 100644
index 0000000..49a9c19
--- /dev/null
+++ b/nn/runtime/test/generated/models/strided_slice_quant8_4.model.cpp
@@ -0,0 +1,37 @@
+// Generated file (from: strided_slice_quant8_4.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type2(Type::INT32, {});
+ OperandType type1(Type::TENSOR_INT32, {1});
+ OperandType type3(Type::TENSOR_QUANT8_ASYMM, {1}, 1.0, 0);
+ OperandType type0(Type::TENSOR_QUANT8_ASYMM, {4}, 1.0, 0);
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto begins = model->addOperand(&type1);
+ auto ends = model->addOperand(&type1);
+ auto strides = model->addOperand(&type1);
+ auto beginMask = model->addOperand(&type2);
+ auto endMask = model->addOperand(&type2);
+ auto output = model->addOperand(&type3);
+ // Phase 2, operations
+ static int32_t begins_init[] = {1};
+ model->setOperandValue(begins, begins_init, sizeof(int32_t) * 1);
+ static int32_t ends_init[] = {-2};
+ model->setOperandValue(ends, ends_init, sizeof(int32_t) * 1);
+ static int32_t strides_init[] = {1};
+ model->setOperandValue(strides, strides_init, sizeof(int32_t) * 1);
+ static int32_t beginMask_init[] = {0};
+ model->setOperandValue(beginMask, beginMask_init, sizeof(int32_t) * 1);
+ static int32_t endMask_init[] = {0};
+ model->setOperandValue(endMask, endMask_init, sizeof(int32_t) * 1);
+ model->addOperation(ANEURALNETWORKS_STRIDED_SLICE, {input, begins, ends, strides, beginMask, endMask}, {output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input},
+ {output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}