| commit | c1a2213d4dd7f89103213a881c852ebaf4e806af | [log] [tgz] |
|---|---|---|
| author | Jack Shen <[email protected]> | Wed Oct 12 06:22:26 2022 |
| committer | Chromeos LUCI <[email protected]> | Thu Oct 13 07:57:35 2022 |
| tree | 941247a6ea5f4906ed073e5679a09891c50369df | |
| parent | e856c2796b6ad742d75abb75bc3489c9d5466afa [diff] |
ml: fix vts called on a disengaged value issue The variable extraParams in aidl vts is a optional, when it is empty, the extraParams->set will fail on error: optional operator-> called on a disengaged value. BUG=b:253138038 TEST=USE="-vendor-nnhal" FEATURES=nostrip emerge-asurada aosp-frameworks-ml-nn-vts && cros_nnapi_vts_aidl Change-Id: I34bb2d02fc78c5d031a992d2a5ea9c8d92f370ef Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/hardware/interfaces/neuralnetworks/+/3947888 Tested-by: Jack Shen <[email protected]> Commit-Queue: Jack Shen <[email protected]> Reviewed-by: Jim Pollock <[email protected]>
diff --git a/aidl/vts/functional/ValidateModel.cpp b/aidl/vts/functional/ValidateModel.cpp index 060434e..089710e 100644 --- a/aidl/vts/functional/ValidateModel.cpp +++ b/aidl/vts/functional/ValidateModel.cpp
@@ -824,6 +824,7 @@ for (size_t i = 0; i < channelQuant.scales.size(); ++i) { channelQuant.scales[i] = 1.0f; } + newOperand.extraParams.emplace(::aidl::android::hardware::neuralnetworks::OperandExtraParams {}); newOperand.extraParams->set<OperandExtraParams::Tag::channelQuant>( std::move(channelQuant)); } break;