Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b2615be authored by Michael K. Sanders's avatar Michael K. Sanders
Browse files

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
parent 2b45d00c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -304,6 +304,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]) {
@@ -318,6 +319,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;
        }