aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/ComparisonLayer.hpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-10-16 17:45:38 +0100
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-10-21 08:52:04 +0000
commit77bfb5e32faadb1383d48364a6f54adbff84ad80 (patch)
tree0bf5dfb48cb8d5c248baf716f02b9f481400316e /src/armnn/layers/ComparisonLayer.hpp
parent5884708e650a80e355398532bc320bbabdbb53f4 (diff)
downloadarmnn-77bfb5e32faadb1383d48364a6f54adbff84ad80.tar.gz
IVGCVSW-3993 Add frontend and reference workload for ComparisonLayer
* Added frontend for ComparisonLayer * Added RefComparisonWorkload * Deprecated and removed Equal and Greater layers and workloads * Updated tests to ensure backward compatibility Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Id50c880be1b567c531efff919c0c366d0a71cbe9
Diffstat (limited to 'src/armnn/layers/ComparisonLayer.hpp')
-rw-r--r--src/armnn/layers/ComparisonLayer.hpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/armnn/layers/ComparisonLayer.hpp b/src/armnn/layers/ComparisonLayer.hpp
new file mode 100644
index 0000000000..bbc2b573bf
--- /dev/null
+++ b/src/armnn/layers/ComparisonLayer.hpp
@@ -0,0 +1,50 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "LayerWithParameters.hpp"
+
+namespace armnn
+{
+
+/// This layer represents a comparison operation.
+class ComparisonLayer : public LayerWithParameters<ComparisonDescriptor>
+{
+public:
+ /// Makes a workload for the Comparison type
+ /// @param [in] graph The graph where this layer can be found
+ /// @param [in] factory The workload factory which will create the workload
+ /// @return A pointer to the created workload, or nullptr if not created
+ virtual std::unique_ptr<IWorkload> CreateWorkload(const Graph& graph,
+ const IWorkloadFactory& factory) const override;
+
+ /// Creates a dynamically-allocated copy of this layer
+ /// @param [in] graph The graph into which this layer is being cloned
+ ComparisonLayer* Clone(Graph& graph) const override;
+
+ /// By default returns inputShapes if the number of inputs are equal to number of outputs,
+ /// otherwise infers the output shapes from given input shapes and layer properties.
+ /// @param [in] inputShapes The input shapes layer has.
+ /// @return A vector to the inferred output shape.
+ std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
+
+ /// Check if the input tensor shape(s) will lead to a valid configuration
+ /// of @ref ComparisonLayer
+ void ValidateTensorShapesFromInputs() override;
+
+ void Accept(ILayerVisitor& visitor) const override;
+
+protected:
+ /// Constructor to create a ComparisonLayer
+ /// @param [in] param ComparisonDescriptor to configure the ComparisonLayer
+ /// @param [in] name Optional name for the layer
+ ComparisonLayer(const ComparisonDescriptor& param, const char* name);
+
+ /// Default destructor
+ ~ComparisonLayer() = default;
+};
+
+} // namespace armnn