aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/Lstm.hpp
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2021-07-28 17:33:28 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2021-08-10 16:49:30 +0000
commite5339e7013cf24e5a34509fb0a60377e5f8a244e (patch)
treec43607bfa497d3694f92d3d080a29b338f93905a /src/backends/reference/workloads/Lstm.hpp
parentc1c872f12797ef6fe52c4589113e7efc353e56eb (diff)
downloadarmnn-experimental/daves_custom_allocator_dmabuf.tar.gz
MLCE-530 Add support for UnidirectionalSequenceLstm to RefWorkloadexperimental/daves_custom_allocator_dmabuf
* 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 <narumol.prangnawarat@arm.com> Change-Id: Ibc066d213213a11b955dfefbe518de643298ba0c
Diffstat (limited to 'src/backends/reference/workloads/Lstm.hpp')
-rw-r--r--src/backends/reference/workloads/Lstm.hpp61
1 files changed, 61 insertions, 0 deletions
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 <armnn/TypesUtils.hpp>
+#include <backendsCommon/WorkloadData.hpp>
+
+#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<Decoder<float>>& inputData,
+ std::unique_ptr<Decoder<float>>& outputStateIn,
+ std::unique_ptr<Decoder<float>>& cellStateIn,
+ std::unique_ptr<Encoder<float>>& outputStateOut,
+ std::unique_ptr<Encoder<float>>& cellStateOut,
+ std::unique_ptr<Encoder<float>>& output,
+ std::unique_ptr<Decoder<float>>& cellStateOutDecoder,
+ std::unique_ptr<Decoder<float>>& outputDecoder,
+ std::unique_ptr<Decoder<float>>& inputToInputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& inputToForgetWeightsTensor,
+ std::unique_ptr<Decoder<float>>& inputToCellWeightsTensor,
+ std::unique_ptr<Decoder<float>>& inputToOutputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& recurrentToInputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& recurrentToForgetWeightsTensor,
+ std::unique_ptr<Decoder<float>>& recurrentToCellWeightsTensor,
+ std::unique_ptr<Decoder<float>>& recurrentToOutputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& cellToInputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& cellToForgetWeightsTensor,
+ std::unique_ptr<Decoder<float>>& cellToOutputWeightsTensor,
+ std::unique_ptr<Decoder<float>>& inputGateBiasTensor,
+ std::unique_ptr<Decoder<float>>& forgetGateBiasTensor,
+ std::unique_ptr<Decoder<float>>& cellBiasTensor,
+ std::unique_ptr<Decoder<float>>& outputGateBiasTensor,
+ std::unique_ptr<Decoder<float>>& projectionWeightsTensor,
+ std::unique_ptr<Decoder<float>>& projectionBiasTensor,
+ std::unique_ptr<Decoder<float>>& inputLayerNormWeights,
+ std::unique_ptr<Decoder<float>>& forgetLayerNormWeights,
+ std::unique_ptr<Decoder<float>>& cellLayerNormWeights,
+ std::unique_ptr<Decoder<float>>& outputLayerNormWeights,
+ std::unique_ptr<Encoder<float>>& inputGateScratch,
+ std::unique_ptr<Encoder<float>>& cellScratch,
+ std::unique_ptr<Encoder<float>>& forgetGateScratch,
+ std::unique_ptr<Encoder<float>>& outputGateScratch,
+ std::unique_ptr<Decoder<float>>& inputGateScratchDecoder,
+ std::unique_ptr<Decoder<float>>& cellScratchDecoder,
+ std::unique_ptr<Decoder<float>>& forgetGateScratchDecoder,
+ std::unique_ptr<Decoder<float>>& outputGateScratchDecoder,
+ float layerNormEpsilon);
+
+} //namespace armnn