From 0ae102a0fc9d66b7067cf8d7a0ed1af5ed65ae50 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Mon, 25 Apr 2022 16:18:57 +0100 Subject: IVGCVSW-6806 Fixed issue with missing TensorInfos in UnidirectionalSequenceLSTM * Corrected TensorInfo order for IsUnidirectionalSequenceLstmSupported * outputStateOut TensorInfo is not optional. * cellStateOut TensorInfo is not optional. * TensorInfo Order matches other QLSTM/LSTM layers. !armnn:7455 Signed-off-by: Mike Kelly Change-Id: I5b0e0fa4b6e1c3da6689d9aefc9b959172c2e7d4 --- test/UnidirectionalSequenceLstm.hpp | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'test/UnidirectionalSequenceLstm.hpp') diff --git a/test/UnidirectionalSequenceLstm.hpp b/test/UnidirectionalSequenceLstm.hpp index d03f8ab3..75b7a8d4 100644 --- a/test/UnidirectionalSequenceLstm.hpp +++ b/test/UnidirectionalSequenceLstm.hpp @@ -138,10 +138,10 @@ void UnidirectionalSequenceLstmTestImpl(const hidl_vec& inputDimension const std::vector& outputLayerNormWeightsValue, const hidl_vec& outputDimensions, const std::vector& outputValue, - const hidl_vec&, - const std::vector&, - const hidl_vec&, - const std::vector&, + const hidl_vec&, // outputStateOutDimensions, + const std::vector&, // outputStateOutValue, + const hidl_vec&, // cellStateOutDimensions, + const std::vector&, // cellStateOutValue, armnn::Compute compute, float epsilonValue = 0) { @@ -519,12 +519,12 @@ void UnidirectionalSequenceLstmLayerFloat32TestImpl(armnn::Compute compute) // 1: The hidden state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, output_size]. This output is optional and can be omitted. If this output // is present then output #2 must be present as well. - hidl_vec hiddenStateOutDimensions{0}; - std::vector hiddenStateOutValue; + hidl_vec hiddenStateOutDimensions{batchSize, outputSize}; + std::vector hiddenStateOutValue(batchSize * outputSize, 0.f); // 2: The cell state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, num_units]. This output is optional and can be omitted. - hidl_vec cellStateOutDimensions{0}; - std::vector cellStateOutValue; + hidl_vec cellStateOutDimensions{batchSize, numUnits}; + std::vector cellStateOutValue(batchSize * numUnits, 0.f); UnidirectionalSequenceLstmTestImpl(inputDimensions, inputValue, inputToInputWeightsDimensions, inputToInputWeightsValue, @@ -724,12 +724,12 @@ void UnidirectionalSequenceLstmLayerFloat32TimeMajorTestImpl(armnn::Compute comp // 1: The hidden state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, output_size]. This output is optional and can be omitted. If this output // is present then output #2 must be present as well. - hidl_vec hiddenStateOutDimensions{0}; - std::vector hiddenStateOutValue; + hidl_vec hiddenStateOutDimensions{batchSize, outputSize}; + std::vector hiddenStateOutValue(batchSize * outputSize, 0.f); // 2: The cell state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, num_units]. This output is optional and can be omitted. - hidl_vec cellStateOutDimensions{0}; - std::vector cellStateOutValue; + hidl_vec cellStateOutDimensions{batchSize, numUnits}; + std::vector cellStateOutValue(batchSize * numUnits, 0.f); UnidirectionalSequenceLstmTestImpl(inputDimensions, inputValue, inputToInputWeightsDimensions, inputToInputWeightsValue, @@ -964,12 +964,12 @@ void UnidirectionalSequenceLstmLayerNoCifgWithPeepholeWithProjectionTestImpl(arm // 1: The hidden state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, output_size]. This output is optional and can be omitted. If this output // is present then output #2 must be present as well. - hidl_vec hiddenStateOutDimensions{0}; - std::vector hiddenStateOutValue; + hidl_vec hiddenStateOutDimensions{batchSize, outputSize}; + std::vector hiddenStateOutValue(batchSize * outputSize, 0.f); // 2: The cell state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, num_units]. This output is optional and can be omitted. - hidl_vec cellStateOutDimensions{0}; - std::vector cellStateOutValue; + hidl_vec cellStateOutDimensions{batchSize, numUnits}; + std::vector cellStateOutValue(batchSize * numUnits, 0.f); UnidirectionalSequenceLstmTestImpl(inputDimensions, inputValue, inputToInputWeightsDimensions, inputToInputWeightsValue, @@ -1179,12 +1179,12 @@ void UnidirectionalSequenceLstmLayerNoCifgWithPeepholeWithProjectionWithLayerNor // 1: The hidden state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, output_size]. This output is optional and can be omitted. If this output // is present then output #2 must be present as well. - hidl_vec hiddenStateOutDimensions{0}; - std::vector hiddenStateOutValue; + hidl_vec hiddenStateOutDimensions{batchSize, outputSize}; + std::vector hiddenStateOutValue(batchSize * outputSize, 0.f); // 2: The cell state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, num_units]. This output is optional and can be omitted. - hidl_vec cellStateOutDimensions{0}; - std::vector cellStateOutValue; + hidl_vec cellStateOutDimensions{batchSize, numUnits}; + std::vector cellStateOutValue(batchSize * numUnits, 0.f); UnidirectionalSequenceLstmTestImpl(inputDimensions, inputValue, inputToInputWeightsDimensions, inputToInputWeightsValue, @@ -1376,12 +1376,12 @@ void UnidirectionalSequenceLstmWithCifgWithPeepholeNoProjectionTestImpl(armnn::C // 1: The hidden state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, output_size]. This output is optional and can be omitted. If this output // is present then output #2 must be present as well. - hidl_vec hiddenStateOutDimensions{0}; - std::vector hiddenStateOutValue; + hidl_vec hiddenStateOutDimensions{batchSize, outputSize}; + std::vector hiddenStateOutValue(batchSize * outputSize, 0.f); // 2: The cell state (out): A 2-D tensor of ANEURALNETWORKS_TENSOR_FLOAT32/16, of shape // [batch_size, num_units]. This output is optional and can be omitted. - hidl_vec cellStateOutDimensions{0}; - std::vector cellStateOutValue; + hidl_vec cellStateOutDimensions{batchSize, numUnits}; + std::vector cellStateOutValue(batchSize * numUnits, 0.f); UnidirectionalSequenceLstmTestImpl(inputDimensions, inputValue, inputToInputWeightsDimensions, inputToInputWeightsValue, -- cgit v1.2.1