From e5339e7013cf24e5a34509fb0a60377e5f8a244e Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Wed, 28 Jul 2021 17:33:28 +0100 Subject: MLCE-530 Add support for UnidirectionalSequenceLstm to RefWorkload * Add implementation of IsUnidirectionalSequenceLstmSupported to RefLayerSupport * Add RefUnidirectionalSequenceLstmWorkload * Refactor Lstm to be able to use for Lstm and SequenceLstm * Unit tests Signed-off-by: Narumol Prangnawarat Change-Id: Ibc066d213213a11b955dfefbe518de643298ba0c --- src/backends/reference/workloads/Lstm.hpp | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/backends/reference/workloads/Lstm.hpp (limited to 'src/backends/reference/workloads/Lstm.hpp') diff --git a/src/backends/reference/workloads/Lstm.hpp b/src/backends/reference/workloads/Lstm.hpp new file mode 100644 index 0000000000..7d0a1d436e --- /dev/null +++ b/src/backends/reference/workloads/Lstm.hpp @@ -0,0 +1,61 @@ +// +// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include +#include + +#include "Encoders.hpp" +#include "Decoders.hpp" + +namespace armnn +{ + +void LstmImpl(const LstmDescriptor& descriptor, + const TensorInfo& inputInfo, + const TensorInfo& outputInfo, + const TensorShape& inputToOutputWeightsShape, + const TensorShape& recurrentToOutputWeightsShape, + std::unique_ptr>& inputData, + std::unique_ptr>& outputStateIn, + std::unique_ptr>& cellStateIn, + std::unique_ptr>& outputStateOut, + std::unique_ptr>& cellStateOut, + std::unique_ptr>& output, + std::unique_ptr>& cellStateOutDecoder, + std::unique_ptr>& outputDecoder, + std::unique_ptr>& inputToInputWeightsTensor, + std::unique_ptr>& inputToForgetWeightsTensor, + std::unique_ptr>& inputToCellWeightsTensor, + std::unique_ptr>& inputToOutputWeightsTensor, + std::unique_ptr>& recurrentToInputWeightsTensor, + std::unique_ptr>& recurrentToForgetWeightsTensor, + std::unique_ptr>& recurrentToCellWeightsTensor, + std::unique_ptr>& recurrentToOutputWeightsTensor, + std::unique_ptr>& cellToInputWeightsTensor, + std::unique_ptr>& cellToForgetWeightsTensor, + std::unique_ptr>& cellToOutputWeightsTensor, + std::unique_ptr>& inputGateBiasTensor, + std::unique_ptr>& forgetGateBiasTensor, + std::unique_ptr>& cellBiasTensor, + std::unique_ptr>& outputGateBiasTensor, + std::unique_ptr>& projectionWeightsTensor, + std::unique_ptr>& projectionBiasTensor, + std::unique_ptr>& inputLayerNormWeights, + std::unique_ptr>& forgetLayerNormWeights, + std::unique_ptr>& cellLayerNormWeights, + std::unique_ptr>& outputLayerNormWeights, + std::unique_ptr>& inputGateScratch, + std::unique_ptr>& cellScratch, + std::unique_ptr>& forgetGateScratch, + std::unique_ptr>& outputGateScratch, + std::unique_ptr>& inputGateScratchDecoder, + std::unique_ptr>& cellScratchDecoder, + std::unique_ptr>& forgetGateScratchDecoder, + std::unique_ptr>& outputGateScratchDecoder, + float layerNormEpsilon); + +} //namespace armnn -- cgit v1.2.1