diff options
author | John Richardson <john.richardson@arm.com> | 2018-04-20 13:11:36 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:51:50 +0000 |
commit | 62385bce6baacfa194cff9e6be6d8eaa73bc3fab (patch) | |
tree | 81d72e49e487ae972423cd57d181ebc53efe487b /src/runtime/CL/functions/CLL2NormalizeLayer.cpp | |
parent | 657bdb358c95ccd6bb07594a01625a7d7bacd32f (diff) | |
download | ComputeLibrary-62385bce6baacfa194cff9e6be6d8eaa73bc3fab.tar.gz |
COMPMID-948: Add validation to CLL2NormalizeLayer
Change-Id: I452a718a60b81da51cd3e98641fd99c86c4debab
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/129451
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLL2NormalizeLayer.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLL2NormalizeLayer.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/runtime/CL/functions/CLL2NormalizeLayer.cpp b/src/runtime/CL/functions/CLL2NormalizeLayer.cpp index d1bb65f1c9..a3010a73ea 100644 --- a/src/runtime/CL/functions/CLL2NormalizeLayer.cpp +++ b/src/runtime/CL/functions/CLL2NormalizeLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -52,6 +52,26 @@ void CLL2NormalizeLayer::configure(ICLTensor *input, ICLTensor *output, unsigned _sumsq.allocator()->allocate(); } +Status CLL2NormalizeLayer::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(CLReductionOperation::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(CLL2NormalizeLayerKernel::validate(input, &sum_sq, output, axis, epsilon)); + + return Status{}; +} + void CLL2NormalizeLayer::run() { _memory_group.acquire(); |