From f29a2c55af463141fac7c92042bfdb9f00ba4ccd Mon Sep 17 00:00:00 2001 From: Kevin May Date: Thu, 14 Mar 2019 11:56:32 +0000 Subject: MLCE-91 LSTM doesn't support optional input * Add fix for optional NO_VALUE operands in ConversionUtils.hpp * Remove fail message for optional NO_VALUE in ConversionUtils.hpp * Add to existing tests and test helper to cover optional NO_VALUE Signed-off-by: Kevin May Change-Id: Icf36af1fc00d3fb33cdd77ff6d6618cc4700d3fd --- test/DriverTestHelpers.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test/DriverTestHelpers.hpp') diff --git a/test/DriverTestHelpers.hpp b/test/DriverTestHelpers.hpp index 4d91ae22..394720ed 100644 --- a/test/DriverTestHelpers.hpp +++ b/test/DriverTestHelpers.hpp @@ -112,7 +112,8 @@ template void AddTensorOperand(HalModel& model, const hidl_vec& dimensions, const T* values, - OperandType operandType = OperandType::TENSOR_FLOAT32) + OperandType operandType = OperandType::TENSOR_FLOAT32, + OperandLifeTime operandLifeTime = OperandLifeTime::CONSTANT_COPY) { uint32_t totalElements = 1; for (uint32_t dim : dimensions) @@ -121,9 +122,13 @@ void AddTensorOperand(HalModel& model, } DataLocation location = {}; - location.offset = model.operandValues.size(); location.length = totalElements * sizeof(T); + if(operandLifeTime == OperandLifeTime::CONSTANT_COPY) + { + location.offset = model.operandValues.size(); + } + Operand op = {}; op.type = operandType; op.dimensions = dimensions; @@ -143,9 +148,10 @@ template void AddTensorOperand(HalModel& model, const hidl_vec& dimensions, const std::vector& values, - OperandType operandType = OperandType::TENSOR_FLOAT32) + OperandType operandType = OperandType::TENSOR_FLOAT32, + OperandLifeTime operandLifeTime = OperandLifeTime::CONSTANT_COPY) { - AddTensorOperand(model, dimensions, values.data(), operandType); + AddTensorOperand(model, dimensions, values.data(), operandType, operandLifeTime); } template -- cgit v1.2.1