From 6433728e2ce74d1e06299909229ee4e79badcf09 Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Mon, 22 Oct 2018 13:49:00 -0700 Subject: [PATCH] Fix VTS ValidationTest for 1.2 ops. Skip L2_NORMALIZATION, LOCAL_RESPONSE_NORMALIZATION, and SOFTMAX for addOperationInputTest. Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver Change-Id: I16de09e2eef7610e564f1f49ff067af7efca3784 --- .../1.2/vts/functional/ValidateModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp index b840199d43..c1c6e55e60 100644 --- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp @@ -479,8 +479,22 @@ static void removeOperationOutputTest(const sp& device, const Model& mo ///////////////////////// ADD OPERATION INPUT ///////////////////////// +static bool addOperationInputSkip(const Operation& operation) { + // Skip addOperationInputTest for the following operations. + // L2_NORMALIZATION, LOCAL_RESPONSE_NORMALIZATION, SOFTMAX can have an optional axis parameter. + if (operation.type == OperationType::L2_NORMALIZATION || + operation.type == OperationType::LOCAL_RESPONSE_NORMALIZATION || + operation.type == OperationType::SOFTMAX) { + return true; + } + return false; +} + static void addOperationInputTest(const sp& device, const Model& model) { for (size_t operation = 0; operation < model.operations.size(); ++operation) { + if (addOperationInputSkip(model.operations[operation])) { + continue; + } const std::string message = "addOperationInputTest: operation " + std::to_string(operation); validate(device, message, model, [operation](Model* model) { uint32_t index = addOperand(model, OperandLifeTime::MODEL_INPUT);