Fixes VTS test failures.
Moves comments for type range values into their enums to make it harder
to forget to update them.
Adds missing float16 types for ARGMAX/ARGMIN/CAST.
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: [ PASSED ] 2519 tests.
Change-Id: Ic7c3df8c8fbff45fe497f304b6b2c7a09e7dc5a6
Merged-In: Ic7c3df8c8fbff45fe497f304b6b2c7a09e7dc5a6
(cherry picked from commit bbdab2feee37c7bc07ce8445d936beea1549370f)
diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
index 8024992..7a9edf4 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
@@ -300,8 +300,9 @@
for (const Operation& operation : model.operations) {
// Skip mutateOperationOperandTypeTest for the following operations.
// - LSH_PROJECTION's second argument is allowed to have any type.
- // - ARGMIN and ARGMAX's first argument can be any of TENSOR_(FLOAT32|INT32|QUANT8_ASYMM).
- // - CAST's argument can be any of TENSOR_(FLOAT32|INT32|QUANT8_ASYMM).
+ // - ARGMIN and ARGMAX's first argument can be any of
+ // TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM).
+ // - CAST's argument can be any of TENSOR_(FLOAT16|FLOAT32|INT32|QUANT8_ASYMM).
switch (operation.type) {
case OperationType::LSH_PROJECTION: {
if (operand == operation.inputs[1]) {
@@ -311,8 +312,8 @@
case OperationType::CAST:
case OperationType::ARGMAX:
case OperationType::ARGMIN: {
- if (type == OperandType::TENSOR_FLOAT32 || type == OperandType::TENSOR_INT32 ||
- type == OperandType::TENSOR_QUANT8_ASYMM) {
+ if (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32 ||
+ type == OperandType::TENSOR_INT32 || type == OperandType::TENSOR_QUANT8_ASYMM) {
return true;
}
} break;