blob: 5abc2c8f7bb44ff2090afefdd3a211230eaeed8f [file] [log] [blame]
Mohamed Nour Abouelseouda1d3c6a2018-12-27 12:39:16 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "Rsqrt.hpp"
7
8#include <cmath>
9
10namespace armnn
11{
12
nikraj0199a66312019-06-06 10:31:27 +010013void Rsqrt(Decoder<float>& in,
14 Encoder<float>& out,
Mohamed Nour Abouelseouda1d3c6a2018-12-27 12:39:16 +000015 const TensorInfo& tensorInfo)
16{
nikraj0199a66312019-06-06 10:31:27 +010017 for (unsigned int i = 0; i < tensorInfo.GetNumElements(); ++i)
Mohamed Nour Abouelseouda1d3c6a2018-12-27 12:39:16 +000018 {
nikraj0199a66312019-06-06 10:31:27 +010019 out[i];
20 in[i];
21 out.Set(1.f / sqrtf(in.Get()));
Mohamed Nour Abouelseouda1d3c6a2018-12-27 12:39:16 +000022 }
23}
24
25} //namespace armnn