aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/Rsqrt.cpp
blob: 5abc2c8f7bb44ff2090afefdd3a211230eaeed8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "Rsqrt.hpp"

#include <cmath>

namespace armnn
{

void Rsqrt(Decoder<float>& in,
           Encoder<float>& out,
           const TensorInfo& tensorInfo)
{
    for (unsigned int i = 0; i < tensorInfo.GetNumElements(); ++i)
    {
        out[i];
        in[i];
        out.Set(1.f / sqrtf(in.Get()));
    }
}

} //namespace armnn