aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/frontend
diff options
context:
space:
mode:
authorthecha01 <theo.charalambous@arm.com>2020-09-01 14:52:38 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2020-09-09 08:58:13 +0000
commit3603aff36444e01083b93e603e8b9b0a254d4911 (patch)
tree2210c3bd8a76654072a2bfa7b84c9151cafc2eee /arm_compute/graph/frontend
parent57f30a9309ff2e5e3b32731a785bf38b01d1fd69 (diff)
downloadComputeLibrary-3603aff36444e01083b93e603e8b9b0a254d4911.tar.gz
Add L2Normalize layer node to Graph API
Signed-off-by: thecha01 <theo.charalambous@arm.com> Change-Id: I5cd26a8829060563d63d8c53e5148631ee053eca Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3912 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/graph/frontend')
-rw-r--r--arm_compute/graph/frontend/Layers.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h
index da664e0448..ba303a3ef6 100644
--- a/arm_compute/graph/frontend/Layers.h
+++ b/arm_compute/graph/frontend/Layers.h
@@ -838,6 +838,32 @@ private:
GenerateProposalsInfo _info;
};
+/** L2 Normalize Layer */
+class L2NormalizeLayer final : public ILayer
+{
+public:
+ /** Construct a L2 Normalize layer.
+ *
+ * @param[in] axis Axis to perform normalization on
+ * @param[in] epsilon Lower bound value for the normalization
+ */
+ L2NormalizeLayer(int axis, float epsilon)
+ : _axis(axis), _epsilon(epsilon)
+ {
+ }
+
+ NodeID create_layer(IStream &s) override
+ {
+ NodeParams common_params = { name(), s.hints().target_hint };
+ NodeIdxPair input = { s.tail_node(), 0 };
+ return GraphBuilder::add_l2_normalize_node(s.graph(), common_params, input, _axis, _epsilon);
+ }
+
+private:
+ int _axis;
+ float _epsilon;
+};
+
/** Normalization Layer */
class NormalizationLayer final : public ILayer
{