diff options
author | Kevin May <kevin.may@arm.com> | 2020-08-20 10:22:53 +0100 |
---|---|---|
committer | Kevin May <kevin.may@arm.com> | 2020-08-20 12:39:46 +0000 |
commit | 81f27fdb53511c8f377ca2d82fc8436ebf675e76 (patch) | |
tree | 8f20f314f965aee8b90a18bfd1584897a359158a | |
parent | 9a0444164b638dddbf480aa4fb081796c687e0fd (diff) | |
download | android-nn-driver-81f27fdb53511c8f377ca2d82fc8436ebf675e76.tar.gz |
IVGCVSW-5224 Fix for UnknownDimensionsTest in CpuRef and GpuAcc
* Correctly handle HalOperandLifeTime::NO_VALUE in ConvertTranspose
Signed-off-by: Kevin May <kevin.may@arm.com>
Change-Id: I36790a90b5a3eac3da9e4edafc96387bb4375db9
-rw-r--r-- | ConversionUtils.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index 51727a31..27d07200 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -3872,6 +3872,7 @@ template<typename HalPolicy, bool ConvertTranspose(const HalOperation& operation, const HalModel& model, ConversionData& data) { using HalOperand = typename HalPolicy::Operand; + using HalOperandLifeTime = typename HalPolicy::OperandLifeTime; LayerInputHandle input = ConvertToLayerInputHandle<HalPolicy>(operation, 0, model, data); if (!input.IsValid()) @@ -3891,9 +3892,8 @@ bool ConvertTranspose(const HalOperation& operation, const HalModel& model, Conv const HalOperand* permOperand = GetInputOperand<HalPolicy>(operation, 1, model, false); std::vector<int32_t> perm(rank); - if (!permOperand) + if (!permOperand || (permOperand->lifetime == HalOperandLifeTime::NO_VALUE)) { - // NOTE: If perm is not given, it is set to (n-1...0), where n is the rank of the tensor for (unsigned int i = rank; i > 0; i--) { perm[rank - i] = boost::numeric_cast<int> (i - 1); |