aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-10-11 14:07:53 +0100
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-10-11 14:36:50 +0000
commitf982deaefbe5fe5814487b27f7099829839b8666 (patch)
treeb65acda6926fd02e341d3dda939dddf4c7e3d35c /include
parenta21620d32a8a0a8d527c061e2a22d51009d75877 (diff)
downloadarmnn-f982deaefbe5fe5814487b27f7099829839b8666.tar.gz
IVGCVSW-3973 Add frontend for LOG_SOFTMAX
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Ic6acc7176deea3753b32ce6340f642d19dce0e9f
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Descriptors.hpp3
-rw-r--r--include/armnn/DescriptorsFwd.hpp12
-rw-r--r--include/armnn/ILayerSupport.hpp5
-rw-r--r--include/armnn/ILayerVisitor.hpp8
-rw-r--r--include/armnn/INetwork.hpp7
-rw-r--r--include/armnn/LayerVisitorBase.hpp4
6 files changed, 34 insertions, 5 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 5bf4043afa..e2e59741a3 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -74,6 +74,9 @@ struct SoftmaxDescriptor
int m_Axis;
};
+/// A LogSoftmaxDescriptor for the LogSoftmaxLayer
+using LogSoftmaxDescriptor = SoftmaxDescriptor;
+
/// @brief An OriginsDescriptor for the ConcatLayer.
/// Descriptor to configure the concatenation process. Number of views must be equal to the number of inputs, and
/// their order must match - e.g. first view corresponds to the first input, second view to the second input, etc.
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index 2cc95828e6..6f1c0e0a6e 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -7,6 +7,7 @@
namespace armnn
{
+
struct ActivationDescriptor;
struct ArgMinMaxDescriptor;
struct BatchNormalizationDescriptor;
@@ -38,10 +39,11 @@ struct StridedSliceDescriptor;
struct TransposeConvolution2dDescriptor;
struct ViewsDescriptor;
+using ConcatDescriptor = OriginsDescriptor;
using DepthToSpaceDescriptor = SpaceToDepthDescriptor;
+using LogSoftmaxDescriptor = SoftmaxDescriptor;
+// MergerDescriptor is deprecated, use ConcatDescriptor instead
+using MergerDescriptor = OriginsDescriptor;
+using SplitterDescriptor = ViewsDescriptor;
-// MergerDescriptor is deprecated use ConcatDescriptor instead
-using MergerDescriptor = OriginsDescriptor;
-using ConcatDescriptor = OriginsDescriptor;
-using SplitterDescriptor = ViewsDescriptor;
-}
+} // namespace armnn
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp
index fef7595b54..31b5e134e9 100644
--- a/include/armnn/ILayerSupport.hpp
+++ b/include/armnn/ILayerSupport.hpp
@@ -168,6 +168,11 @@ public:
const L2NormalizationDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+ virtual bool IsLogSoftmaxSupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const LogSoftmaxDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+
virtual bool IsLstmSupported(const TensorInfo& input,
const TensorInfo& outputStateIn,
const TensorInfo& cellStateIn,
diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp
index b9c96d5448..e99e10f800 100644
--- a/include/armnn/ILayerVisitor.hpp
+++ b/include/armnn/ILayerVisitor.hpp
@@ -224,6 +224,14 @@ public:
const L2NormalizationDescriptor& desc,
const char* name = nullptr) = 0;
+ /// Function that a log softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked.
+ /// @param layer - pointer to the layer which is calling back to this visit function.
+ /// @param logSoftmaxDescriptor - LogSoftmaxDescriptor to configure the log softmax.
+ /// @param name - Optional name for the layer.
+ virtual void VisitLogSoftmaxLayer(const IConnectableLayer* layer,
+ const LogSoftmaxDescriptor& logSoftmaxDescriptor,
+ const char* name = nullptr) = 0;
+
/// Function an Lstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.
/// @param layer - pointer to the layer which is calling back to this visit function.
/// @param descriptor - Parameters controlling the operation of the Lstm operation.
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index dc831db864..d12f5c239c 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -344,6 +344,13 @@ public:
virtual IConnectableLayer* AddL2NormalizationLayer(const L2NormalizationDescriptor& desc,
const char* name = nullptr) = 0;
+ /// Adds a log softmax layer to the network.
+ /// @param logSoftmaxDescriptor - LogSoftmaxDescriptor to configure the log softmax.
+ /// @param name - Optional name for the layer.
+ /// @return - Interface for configuring the layer.
+ virtual IConnectableLayer* AddLogSoftmaxLayer(const LogSoftmaxDescriptor& logSoftmaxDescriptor,
+ const char* name = nullptr) = 0;
+
/// Adds a layer with no inputs and a single output, which always corresponds to
/// the passed in constant tensor.
/// @param input - Tensor to be provided as the only output of the layer. The layer will maintain
diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp
index 719e59d39c..912f25500c 100644
--- a/include/armnn/LayerVisitorBase.hpp
+++ b/include/armnn/LayerVisitorBase.hpp
@@ -120,6 +120,10 @@ public:
const L2NormalizationDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
+ void VisitLogSoftmaxLayer(const IConnectableLayer*,
+ const LogSoftmaxDescriptor&,
+ const char*) override { DefaultPolicy::Apply(__func__); }
+
void VisitLstmLayer(const IConnectableLayer*,
const LstmDescriptor&,
const LstmInputParams&,