Adds float16 support for RANDOM_MULTINOMIAL.

Bug: 118607845
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Change-Id: Iac8c0c23a8219702697a7a126e5e2e43ef0461f4
Merged-In: Iac8c0c23a8219702697a7a126e5e2e43ef0461f4
(cherry picked from commit 5b2615be21)
This commit is contained in:
Michael K. Sanders
2018-12-06 12:34:07 +00:00
parent 4766f8b1a1
commit 41e6732a66

View File

@@ -325,6 +325,7 @@ static bool mutateOperationOperandTypeSkip(size_t operand, OperandType type, con
// - 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).
// - RANDOM_MULTINOMIAL's argument can be either TENSOR_FLOAT16 or TENSOR_FLOAT32.
switch (operation.type) {
case OperationType::LSH_PROJECTION: {
if (operand == operation.inputs[1]) {
@@ -339,6 +340,11 @@ static bool mutateOperationOperandTypeSkip(size_t operand, OperandType type, con
return true;
}
} break;
case OperationType::RANDOM_MULTINOMIAL: {
if (type == OperandType::TENSOR_FLOAT16 || type == OperandType::TENSOR_FLOAT32) {
return true;
}
} break;
default:
break;
}