diff options
author | John Richardson <john.richardson@arm.com> | 2018-05-08 14:34:33 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:52:35 +0000 |
commit | 73d4aef12463ac42fa9e31174675f32535a7edd8 (patch) | |
tree | 31707cdf30e99ee6a0e55db4eda34090349bc572 /src/runtime/NEON/functions/NEL2NormalizeLayer.cpp | |
parent | 5415a0267523931bae0a012db2438fa7cc89a549 (diff) | |
download | ComputeLibrary-73d4aef12463ac42fa9e31174675f32535a7edd8.tar.gz |
COMPMID-948: Add validation to NEL2NormalizeLayer
Change-Id: I0cfea24884066412c2f13d9acdb72ddbccac7545
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/130407
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEL2NormalizeLayer.cpp')
-rw-r--r-- | src/runtime/NEON/functions/NEL2NormalizeLayer.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp b/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp index fa62483146..d0b80fb1b8 100644 --- a/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp +++ b/src/runtime/NEON/functions/NEL2NormalizeLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -46,6 +46,26 @@ void NEL2NormalizeLayer::configure(ITensor *input, ITensor *output, unsigned int _sumsq.allocator()->allocate(); } +Status NEL2NormalizeLayer::validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, float epsilon) +{ + TensorShape shape(input->tensor_shape()); + + // Create intermediate tensor info + TensorInfo sum_sq; + sum_sq.set_data_type(input->data_type()); + sum_sq.set_tensor_shape(shape); + + ARM_COMPUTE_RETURN_ON_ERROR(NEReductionOperation::validate(input, &sum_sq, axis, ReductionOperation::SUM_SQUARE)); + + // Reduce shape on axis (supported axis is 0) + shape.set(0, 1); + sum_sq.set_tensor_shape(shape); + + ARM_COMPUTE_RETURN_ON_ERROR(NEL2NormalizeLayerKernel::validate(input, &sum_sq, output, axis, epsilon)); + + return Status{}; +} + void NEL2NormalizeLayer::run() { _memory_group.acquire(); |