summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-05-19 01:05:00 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-05-19 01:05:00 +0000
commit196188dee0b1c40318b8b73d44c69567712736a3 (patch)
treec4cc08c4c4528d8f7328cd770a665e1278eb9630
parentf211b752b8011616e922d4c8f1947997435d296f (diff)
parent3594be18553db032e3af6dae5c6b9e310eb2f3d8 (diff)
downloadml-196188dee0b1c40318b8b73d44c69567712736a3.tar.gz
Snap for 6507440 from 3594be18553db032e3af6dae5c6b9e310eb2f3d8 to rvc-release
Change-Id: I7b3879df4a4cd2c1125b83cf155dfa8a26691784
-rw-r--r--nn/common/OperationsUtils.cpp18
-rw-r--r--nn/common/operations/StridedSlice.cpp5
-rw-r--r--nn/runtime/include/NeuralNetworks.h8
-rw-r--r--nn/runtime/test/generated/spec_V1_1/mean_b155508675.example.cpp174
-rw-r--r--nn/runtime/test/generated/spec_V1_1/squeeze_b155238914.example.cpp154
-rw-r--r--nn/runtime/test/generated/spec_V1_1/strided_slice_b155662254.example.cpp254
-rw-r--r--nn/runtime/test/generated/spec_V1_2/argmax_b155660285.example.cpp154
-rw-r--r--nn/runtime/test/generated/spec_V1_2/argmin_b155660285.example.cpp154
-rw-r--r--nn/runtime/test/generated/spec_V1_2/squeeze_b155238914.example.cpp87
-rw-r--r--nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp502
-rw-r--r--nn/runtime/test/specs/V1_1/mean_b155508675.mod.py29
-rw-r--r--nn/runtime/test/specs/V1_1/squeeze_b155238914.mod.py (renamed from nn/runtime/test/specs/V1_2/squeeze_b155238914.mod.py)17
-rw-r--r--nn/runtime/test/specs/V1_1/strided_slice_b155662254.mod.py29
-rw-r--r--nn/runtime/test/specs/V1_2/argmax_b155660285.mod.py29
-rw-r--r--nn/runtime/test/specs/V1_2/argmin_b155660285.mod.py29
-rw-r--r--nn/tools/api/types.spec8
16 files changed, 1047 insertions, 604 deletions
diff --git a/nn/common/OperationsUtils.cpp b/nn/common/OperationsUtils.cpp
index e5031473e..e8dd3e2ba 100644
--- a/nn/common/OperationsUtils.cpp
+++ b/nn/common/OperationsUtils.cpp
@@ -658,6 +658,10 @@ bool meanPrepare(const Shape& input, const int32_t* axisData, const Shape& axisS
outDims[idx - numSkipAxis] = getSizeOfDimension(input, idx);
}
}
+ // Handle the case when all dimensions are removed
+ if (outDims.empty()) {
+ outDims.push_back(1);
+ }
output->dimensions = outDims;
}
@@ -675,11 +679,15 @@ bool argMinMaxPrepare(const Shape& input, int32_t axis, Shape* output) {
// Copy the input dimensions, omitting the axis dimension.
output->dimensions.clear();
- output->dimensions.reserve(getNumberOfDimensions(input) - 1);
- output->dimensions.insert(output->dimensions.end(), input.dimensions.begin(),
- input.dimensions.begin() + axis);
- output->dimensions.insert(output->dimensions.end(), input.dimensions.begin() + axis + 1,
- input.dimensions.end());
+ if (getNumberOfDimensions(input) > 1) {
+ output->dimensions.reserve(getNumberOfDimensions(input) - 1);
+ output->dimensions.insert(output->dimensions.end(), input.dimensions.begin(),
+ input.dimensions.begin() + axis);
+ output->dimensions.insert(output->dimensions.end(), input.dimensions.begin() + axis + 1,
+ input.dimensions.end());
+ } else {
+ output->dimensions.push_back(1);
+ }
return true;
}
diff --git a/nn/common/operations/StridedSlice.cpp b/nn/common/operations/StridedSlice.cpp
index cd972d3de..5ff5aeca8 100644
--- a/nn/common/operations/StridedSlice.cpp
+++ b/nn/common/operations/StridedSlice.cpp
@@ -191,6 +191,11 @@ bool prepare(IOperationExecutionContext* context) {
}
}
+ // Handle the case when all dimensions are removed
+ if (outDims.empty()) {
+ outDims.push_back(1);
+ }
+
Shape outputShape = context->getOutputShape(kOutputTensor);
NN_RET_CHECK(SetShape(inputShape, &outputShape));
outputShape.dimensions = outDims;
diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h
index 82c668371..239cb6185 100644
--- a/nn/runtime/include/NeuralNetworks.h
+++ b/nn/runtime/include/NeuralNetworks.h
@@ -2201,6 +2201,8 @@ typedef enum {
* For a {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} and
* {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
*
* Available since API level 28.
*/
@@ -2336,6 +2338,8 @@ typedef enum {
* For a {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} and
* {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
+ * If all input dimensions are equal to 1 and are to be squeezed, the
+ * output shape is [1].
*
* Available since API level 28.
*/
@@ -2387,6 +2391,8 @@ typedef enum {
* For a {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} and
* {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED} tensor,
* the scale and zeroPoint must be the same as input0.
+ * If shrink_axis_mask is true for all input dimensions, the output
+ * shape is [1].
*
* Available since API level 28.
*/
@@ -2520,6 +2526,7 @@ typedef enum {
*
* Outputs:
* * 0: An (n - 1)-D {@link ANEURALNETWORKS_TENSOR_INT32} tensor.
+ * If input is 1-dimensional, the output shape is [1].
*
* Available since API level 29.
*/
@@ -2547,6 +2554,7 @@ typedef enum {
*
* Outputs:
* * 0: An (n - 1)-D {@link ANEURALNETWORKS_TENSOR_INT32} tensor.
+ * If input is 1-dimensional, the output shape is [1].
*
* Available since API level 29.
*/
diff --git a/nn/runtime/test/generated/spec_V1_1/mean_b155508675.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_b155508675.example.cpp
new file mode 100644
index 000000000..4cd5424b8
--- /dev/null
+++ b/nn/runtime/test/generated/spec_V1_1/mean_b155508675.example.cpp
@@ -0,0 +1,174 @@
+// Generated from mean_b155508675.mod.py
+// DO NOT EDIT
+// clang-format off
+#include "TestHarness.h"
+using namespace test_helper;
+
+namespace generated_tests::mean_b155508675 {
+
+const TestModel& get_test_model() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {0},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 3.0f, 4.0f}),
+ .dimensions = {2, 2, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0, 1, 2}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({3.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {0, 1, 2},
+ .outputs = {3},
+ .type = TestOperationType::MEAN
+ }},
+ .outputIndexes = {3}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model = TestModelManager::get().add("mean_b155508675", get_test_model());
+
+} // namespace generated_tests::mean_b155508675
+
+namespace generated_tests::mean_b155508675 {
+
+const TestModel& get_test_model_all_inputs_as_internal() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {4},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({}),
+ .dimensions = {2, 2, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0, 1, 2}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({3.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // op1_new
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 3.0f, 4.0f}),
+ .dimensions = {2, 2, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // dummy
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {4, 5, 6},
+ .outputs = {0},
+ .type = TestOperationType::ADD
+ }, {
+ .inputs = {0, 1, 2},
+ .outputs = {3},
+ .type = TestOperationType::MEAN
+ }},
+ .outputIndexes = {3}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("mean_b155508675_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
+
+} // namespace generated_tests::mean_b155508675
+
diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze_b155238914.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze_b155238914.example.cpp
new file mode 100644
index 000000000..1dec0599e
--- /dev/null
+++ b/nn/runtime/test/generated/spec_V1_1/squeeze_b155238914.example.cpp
@@ -0,0 +1,154 @@
+// Generated from squeeze_b155238914.mod.py
+// DO NOT EDIT
+// clang-format off
+#include "TestHarness.h"
+using namespace test_helper;
+
+namespace generated_tests::squeeze_b155238914 {
+
+const TestModel& get_test_model() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {0},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1, 1, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({}),
+ .dimensions = {0},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::NO_VALUE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // op3
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::SQUEEZE
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model = TestModelManager::get().add("squeeze_b155238914", get_test_model());
+
+} // namespace generated_tests::squeeze_b155238914
+
+namespace generated_tests::squeeze_b155238914 {
+
+const TestModel& get_test_model_all_inputs_as_internal() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {3},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({}),
+ .dimensions = {1, 1, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({}),
+ .dimensions = {0},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::NO_VALUE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // op3
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // op1_new
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1, 1, 1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // dummy
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {3, 4, 5},
+ .outputs = {0},
+ .type = TestOperationType::ADD
+ }, {
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::SQUEEZE
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("squeeze_b155238914_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
+
+} // namespace generated_tests::squeeze_b155238914
+
diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_b155662254.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_b155662254.example.cpp
new file mode 100644
index 000000000..2923cbe9f
--- /dev/null
+++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_b155662254.example.cpp
@@ -0,0 +1,254 @@
+// Generated from strided_slice_b155662254.mod.py
+// DO NOT EDIT
+// clang-format off
+#include "TestHarness.h"
+using namespace test_helper;
+
+namespace generated_tests::strided_slice_b155662254 {
+
+const TestModel& get_test_model() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {0},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f}),
+ .dimensions = {4},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param3
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // param4
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // param5
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {0, 1, 2, 3, 4, 5, 6},
+ .outputs = {7},
+ .type = TestOperationType::STRIDED_SLICE
+ }},
+ .outputIndexes = {7}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model = TestModelManager::get().add("strided_slice_b155662254", get_test_model());
+
+} // namespace generated_tests::strided_slice_b155662254
+
+namespace generated_tests::strided_slice_b155662254 {
+
+const TestModel& get_test_model_all_inputs_as_internal() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {8},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({}),
+ .dimensions = {4},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // param3
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // param4
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // param5
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({1}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // op1_new
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f}),
+ .dimensions = {4},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // dummy
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param6
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {8, 9, 10},
+ .outputs = {0},
+ .type = TestOperationType::ADD
+ }, {
+ .inputs = {0, 1, 2, 3, 4, 5, 6},
+ .outputs = {7},
+ .type = TestOperationType::STRIDED_SLICE
+ }},
+ .outputIndexes = {7}
+ },
+ .minSupportedVersion = TestHalVersion::V1_1,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("strided_slice_b155662254_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
+
+} // namespace generated_tests::strided_slice_b155662254
+
diff --git a/nn/runtime/test/generated/spec_V1_2/argmax_b155660285.example.cpp b/nn/runtime/test/generated/spec_V1_2/argmax_b155660285.example.cpp
new file mode 100644
index 000000000..1ebca7225
--- /dev/null
+++ b/nn/runtime/test/generated/spec_V1_2/argmax_b155660285.example.cpp
@@ -0,0 +1,154 @@
+// Generated from argmax_b155660285.mod.py
+// DO NOT EDIT
+// clang-format off
+#include "TestHarness.h"
+using namespace test_helper;
+
+namespace generated_tests::argmax_b155660285 {
+
+const TestModel& get_test_model() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {0},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({2}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::ARGMAX
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_2,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model = TestModelManager::get().add("argmax_b155660285", get_test_model());
+
+} // namespace generated_tests::argmax_b155660285
+
+namespace generated_tests::argmax_b155660285 {
+
+const TestModel& get_test_model_all_inputs_as_internal() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {3},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({2}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // op1_new
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // dummy
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {3, 4, 5},
+ .outputs = {0},
+ .type = TestOperationType::ADD
+ }, {
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::ARGMAX
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_2,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("argmax_b155660285_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
+
+} // namespace generated_tests::argmax_b155660285
+
diff --git a/nn/runtime/test/generated/spec_V1_2/argmin_b155660285.example.cpp b/nn/runtime/test/generated/spec_V1_2/argmin_b155660285.example.cpp
new file mode 100644
index 000000000..cfa50c640
--- /dev/null
+++ b/nn/runtime/test/generated/spec_V1_2/argmin_b155660285.example.cpp
@@ -0,0 +1,154 @@
+// Generated from argmin_b155660285.mod.py
+// DO NOT EDIT
+// clang-format off
+#include "TestHarness.h"
+using namespace test_helper;
+
+namespace generated_tests::argmin_b155660285 {
+
+const TestModel& get_test_model() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {0},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({4.0f, 2.0f, 1.0f}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({2}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::ARGMIN
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_2,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model = TestModelManager::get().add("argmin_b155660285", get_test_model());
+
+} // namespace generated_tests::argmin_b155660285
+
+namespace generated_tests::argmin_b155660285 {
+
+const TestModel& get_test_model_all_inputs_as_internal() {
+ static TestModel model = {
+ .expectFailure = false,
+ .expectedMultinomialDistributionTolerance = 0,
+ .isRelaxed = false,
+ .main = {
+ .inputIndexes = {3},
+ .operands = {{ // op1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }, { // op2
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({2}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
+ .numberOfConsumers = 0,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_INT32,
+ .zeroPoint = 0
+ }, { // op1_new
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({4.0f, 2.0f, 1.0f}),
+ .dimensions = {3},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // dummy
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<float>({0.0f}),
+ .dimensions = {1},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::TENSOR_FLOAT32,
+ .zeroPoint = 0
+ }, { // param1
+ .channelQuant = {},
+ .data = TestBuffer::createFromVector<int32_t>({0}),
+ .dimensions = {},
+ .isIgnored = false,
+ .lifetime = TestOperandLifeTime::CONSTANT_COPY,
+ .numberOfConsumers = 1,
+ .scale = 0.0f,
+ .type = TestOperandType::INT32,
+ .zeroPoint = 0
+ }},
+ .operations = {{
+ .inputs = {3, 4, 5},
+ .outputs = {0},
+ .type = TestOperationType::ADD
+ }, {
+ .inputs = {0, 1},
+ .outputs = {2},
+ .type = TestOperationType::ARGMIN
+ }},
+ .outputIndexes = {2}
+ },
+ .minSupportedVersion = TestHalVersion::V1_2,
+ .referenced = {}
+ };
+ return model;
+}
+
+const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("argmin_b155660285_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
+
+} // namespace generated_tests::argmin_b155660285
+
diff --git a/nn/runtime/test/generated/spec_V1_2/squeeze_b155238914.example.cpp b/nn/runtime/test/generated/spec_V1_2/squeeze_b155238914.example.cpp
deleted file mode 100644
index c2fad450f..000000000
--- a/nn/runtime/test/generated/spec_V1_2/squeeze_b155238914.example.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// Generated from squeeze_b155238914.mod.py
-// DO NOT EDIT
-// clang-format off
-#include "TestHarness.h"
-using namespace test_helper;
-
-namespace generated_tests::squeeze_b155238914 {
-
-const TestModel& get_test_model() {
- static TestModel model = {
- .expectFailure = false,
- .expectedMultinomialDistributionTolerance = 0,
- .isRelaxed = false,
- .main = {
- .inputIndexes = {0},
- .operands = {{ // op0
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}),
- .dimensions = {9, 1, 1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // op1
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}),
- .dimensions = {9, 1, 1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // op5
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f}),
- .dimensions = {1, 1, 1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // op7
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({}),
- .dimensions = {0},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::NO_VALUE,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // op8
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }},
- .operations = {{
- .inputs = {0},
- .outputs = {1},
- .type = TestOperationType::FLOOR
- }, {
- .inputs = {2, 3},
- .outputs = {4},
- .type = TestOperationType::SQUEEZE
- }},
- .outputIndexes = {1}
- },
- .minSupportedVersion = TestHalVersion::V1_2,
- .referenced = {}
- };
- return model;
-}
-
-const auto dummy_test_model = TestModelManager::get().add("squeeze_b155238914", get_test_model());
-
-} // namespace generated_tests::squeeze_b155238914
-
diff --git a/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp b/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp
deleted file mode 100644
index f164c190a..000000000
--- a/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-// Generated from strided_slice_invalid_output_dims.mod.py
-// DO NOT EDIT
-// clang-format off
-#include "TestHarness.h"
-using namespace test_helper;
-
-namespace generated_tests::strided_slice_invalid_output_dims {
-
-const TestModel& get_test_model() {
- static TestModel model = {
- .expectFailure = true,
- .expectedMultinomialDistributionTolerance = 0,
- .isRelaxed = false,
- .main = {
- .inputIndexes = {0},
- .operands = {{ // input
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // begins
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0, 0}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // ends
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({2, 3}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // strides
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1, 1}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // beginMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // endMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // shrinkAxisMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // output
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}),
- .dimensions = {3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }},
- .operations = {{
- .inputs = {0, 1, 2, 3, 4, 5, 6},
- .outputs = {7},
- .type = TestOperationType::STRIDED_SLICE
- }},
- .outputIndexes = {7}
- },
- .minSupportedVersion = TestHalVersion::V1_2,
- .referenced = {}
- };
- return model;
-}
-
-const auto dummy_test_model = TestModelManager::get().add("strided_slice_invalid_output_dims", get_test_model());
-
-} // namespace generated_tests::strided_slice_invalid_output_dims
-
-namespace generated_tests::strided_slice_invalid_output_dims {
-
-const TestModel& get_test_model_all_inputs_as_internal() {
- static TestModel model = {
- .expectFailure = true,
- .expectedMultinomialDistributionTolerance = 0,
- .isRelaxed = false,
- .main = {
- .inputIndexes = {8},
- .operands = {{ // input
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // begins
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0, 0}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // ends
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({2, 3}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // strides
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1, 1}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // beginMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // endMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // shrinkAxisMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // output
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}),
- .dimensions = {3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // input_new
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // dummy
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f}),
- .dimensions = {1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // param
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }},
- .operations = {{
- .inputs = {8, 9, 10},
- .outputs = {0},
- .type = TestOperationType::ADD
- }, {
- .inputs = {0, 1, 2, 3, 4, 5, 6},
- .outputs = {7},
- .type = TestOperationType::STRIDED_SLICE
- }},
- .outputIndexes = {7}
- },
- .minSupportedVersion = TestHalVersion::V1_2,
- .referenced = {}
- };
- return model;
-}
-
-const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("strided_slice_invalid_output_dims_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
-
-} // namespace generated_tests::strided_slice_invalid_output_dims
-
-namespace generated_tests::strided_slice_invalid_output_dims {
-
-const TestModel& get_test_model_all_tensors_as_inputs() {
- static TestModel model = {
- .expectFailure = true,
- .expectedMultinomialDistributionTolerance = 0,
- .isRelaxed = false,
- .main = {
- .inputIndexes = {0, 1, 2, 3},
- .operands = {{ // input
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // begins
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0, 0}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // ends
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({2, 3}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // strides
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1, 1}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // beginMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // endMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // shrinkAxisMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // output
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}),
- .dimensions = {3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }},
- .operations = {{
- .inputs = {0, 1, 2, 3, 4, 5, 6},
- .outputs = {7},
- .type = TestOperationType::STRIDED_SLICE
- }},
- .outputIndexes = {7}
- },
- .minSupportedVersion = TestHalVersion::V1_2,
- .referenced = {}
- };
- return model;
-}
-
-const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_invalid_output_dims_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs());
-
-} // namespace generated_tests::strided_slice_invalid_output_dims
-
-namespace generated_tests::strided_slice_invalid_output_dims {
-
-const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
- static TestModel model = {
- .expectFailure = true,
- .expectedMultinomialDistributionTolerance = 0,
- .isRelaxed = false,
- .main = {
- .inputIndexes = {1, 2, 3, 8},
- .operands = {{ // input
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // begins
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0, 0}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // ends
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({2, 3}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // strides
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1, 1}),
- .dimensions = {2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_INT32,
- .zeroPoint = 0
- }, { // beginMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // endMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // shrinkAxisMask
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({1}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }, { // output
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}),
- .dimensions = {3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
- .numberOfConsumers = 0,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // input_new
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
- .dimensions = {2, 3},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // dummy1
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f}),
- .dimensions = {1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // param1
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
- }},
- .operations = {{
- .inputs = {8, 9, 10},
- .outputs = {0},
- .type = TestOperationType::ADD
- }, {
- .inputs = {0, 1, 2, 3, 4, 5, 6},
- .outputs = {7},
- .type = TestOperationType::STRIDED_SLICE
- }},
- .outputIndexes = {7}
- },
- .minSupportedVersion = TestHalVersion::V1_2,
- .referenced = {}
- };
- return model;
-}
-
-const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_invalid_output_dims_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal());
-
-} // namespace generated_tests::strided_slice_invalid_output_dims
-
diff --git a/nn/runtime/test/specs/V1_1/mean_b155508675.mod.py b/nn/runtime/test/specs/V1_1/mean_b155508675.mod.py
new file mode 100644
index 000000000..99bfbe63d
--- /dev/null
+++ b/nn/runtime/test/specs/V1_1/mean_b155508675.mod.py
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# 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 operands
+op1 = Input("op1", ["TENSOR_FLOAT32", [2, 2, 1]])
+op2 = Output("op2", ["TENSOR_FLOAT32", [1]])
+
+# Model operations
+model = Model()
+model.Operation("MEAN", op1, [0, 1, 2], 0).To(op2)
+
+# Example
+Example({
+ op1: [2.0, 3.0, 3.0, 4.0],
+ op2: [3.0],
+}, model=model)
diff --git a/nn/runtime/test/specs/V1_2/squeeze_b155238914.mod.py b/nn/runtime/test/specs/V1_1/squeeze_b155238914.mod.py
index 70e41c6d3..75ac4381f 100644
--- a/nn/runtime/test/specs/V1_2/squeeze_b155238914.mod.py
+++ b/nn/runtime/test/specs/V1_1/squeeze_b155238914.mod.py
@@ -14,19 +14,16 @@
# limitations under the License.
#
# Model operands
-op0 = Input("op0", ["TENSOR_FLOAT32", [9, 1, 1]])
-op1 = Output("op1", ["TENSOR_FLOAT32", [9, 1, 1]])
-op5 = Parameter("op5", ["TENSOR_FLOAT32", [1, 1, 1]], [0])
-op7 = Parameter("op7", ["TENSOR_INT32", [0]], value=None) # omitted
-op8 = Internal("op8", ["TENSOR_FLOAT32", []])
+op1 = Input("op1", ["TENSOR_FLOAT32", [1, 1, 1]], [0])
+op2 = Parameter("op2", ["TENSOR_INT32", [0]], value=None) # omitted
+op3 = Output("op3", ["TENSOR_FLOAT32", [1]])
# Model operations
model = Model()
-model.Operation("FLOOR", op0).To(op1)
-model.Operation("SQUEEZE", op5, op7).To(op8)
+model.Operation("SQUEEZE", op1, op2).To(op3)
# Example
Example({
- op0: [0, 0, 0, 0, 0, 0, 0, 0, 0],
- op1: [0, 0, 0, 0, 0, 0, 0, 0, 0],
-}, model=model).DisableLifeTimeVariation()
+ op1: [0],
+ op3: [0]
+}, model=model)
diff --git a/nn/runtime/test/specs/V1_1/strided_slice_b155662254.mod.py b/nn/runtime/test/specs/V1_1/strided_slice_b155662254.mod.py
new file mode 100644
index 000000000..908f8563d
--- /dev/null
+++ b/nn/runtime/test/specs/V1_1/strided_slice_b155662254.mod.py
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# 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 operands
+op1 = Input("op1", ["TENSOR_FLOAT32", [4]])
+op2 = Output("op2", ["TENSOR_FLOAT32", [1]])
+
+# Model operations
+model = Model()
+model.Operation("STRIDED_SLICE", op1, [0], [1], [1], 0, 0, 1).To(op2)
+
+# Example
+Example({
+ op1: [0.0, 1.0, 2.0, 3.0],
+ op2: [0.0],
+}, model=model)
diff --git a/nn/runtime/test/specs/V1_2/argmax_b155660285.mod.py b/nn/runtime/test/specs/V1_2/argmax_b155660285.mod.py
new file mode 100644
index 000000000..6247e1519
--- /dev/null
+++ b/nn/runtime/test/specs/V1_2/argmax_b155660285.mod.py
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# 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 operands
+op1 = Input("op1", ["TENSOR_FLOAT32", [3]])
+op2 = Output("op2", ["TENSOR_INT32", [1]])
+
+# Model operations
+model = Model()
+model.Operation("ARGMAX", op1, 0).To(op2)
+
+# Example
+Example({
+ op1: [1.0, 2.0, 4.0],
+ op2: [2],
+}, model=model)
diff --git a/nn/runtime/test/specs/V1_2/argmin_b155660285.mod.py b/nn/runtime/test/specs/V1_2/argmin_b155660285.mod.py
new file mode 100644
index 000000000..a59500a6a
--- /dev/null
+++ b/nn/runtime/test/specs/V1_2/argmin_b155660285.mod.py
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# 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 operands
+op1 = Input("op1", ["TENSOR_FLOAT32", [3]])
+op2 = Output("op2", ["TENSOR_INT32", [1]])
+
+# Model operations
+model = Model()
+model.Operation("ARGMIN", op1, 0).To(op2)
+
+# Example
+Example({
+ op1: [4.0, 2.0, 1.0],
+ op2: [2],
+}, model=model)
diff --git a/nn/tools/api/types.spec b/nn/tools/api/types.spec
index 606af5eaa..bb91b9e43 100644
--- a/nn/tools/api/types.spec
+++ b/nn/tools/api/types.spec
@@ -2521,6 +2521,8 @@
* For a {@link %{OperandTypeLinkPfx}TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
%/kind
+ * If all dimensions are reduced and keep_dims is false, the output
+ * shape is [1].
%insert-lines AVAIL28
*/
%{DeclareOperation MEAN 31},
@@ -2690,6 +2692,8 @@
* For a {@link %{OperandTypeLinkPfx}TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
%/kind
+ * If all input dimensions are equal to 1 and are to be squeezed, the
+ * output shape is [1].
%insert-lines AVAIL28
*/
%{DeclareOperation SQUEEZE 34},
@@ -2749,6 +2753,8 @@
* For a {@link %{OperandTypeLinkPfx}TENSOR_QUANT8_ASYMM} tensor,
* the scale and zeroPoint must be the same as input0.
%/kind
+ * If shrink_axis_mask is true for all input dimensions, the output
+ * shape is [1].
%insert-lines AVAIL28
*/
%{DeclareOperation STRIDED_SLICE 35},
@@ -3009,6 +3015,7 @@
*
* Outputs:
* * 0: An (n - 1)-D {@link %{OperandTypeLinkPfx}TENSOR_INT32} tensor.
+ * If input is 1-dimensional, the output shape is [1].
%insert-lines AVAIL29
*/
// There is no underscore in ARG_MAX to avoid name conflict with
@@ -3037,6 +3044,7 @@
*
* Outputs:
* * 0: An (n - 1)-D {@link %{OperandTypeLinkPfx}TENSOR_INT32} tensor.
+ * If input is 1-dimensional, the output shape is [1].
%insert-lines AVAIL29
*/
%{DeclareOperation_1.2 ARGMIN 40}, // See ARGMAX for naming discussion.