24.02
SquaredDifference.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#pragma once
7
8
#include <cmath>
9
10
namespace
armnn
11
{
12
13
template
<
typename
T>
14
struct
squaredDifference
15
{
16
typedef
T
result_type
;
17
typedef
T
first_argument_type
;
18
19
T
20
operator()
(
const
T& input1,
const
T& input2)
const
21
{
22
float
diff = std::minus<>{}(
static_cast<
float
>
(input1),
static_cast<
float
>
(input2));
23
T squaredDiff = armnn::numeric_cast<T>(std::pow(
static_cast<
float
>
(diff), 2));
24
return
squaredDiff;
25
}
26
};
27
28
}
//namespace armnn
armnn::squaredDifference::result_type
T result_type
Definition:
SquaredDifference.hpp:16
armnn::squaredDifference::operator()
T operator()(const T &input1, const T &input2) const
Definition:
SquaredDifference.hpp:20
armnn::squaredDifference::first_argument_type
T first_argument_type
Definition:
SquaredDifference.hpp:17
armnn::squaredDifference
Definition:
SquaredDifference.hpp:14
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
src
backends
reference
workloads
SquaredDifference.hpp
Generated on Wed Feb 14 2024 16:36:17 for Arm NN by
1.8.17