47 val =
static_cast<intermediate_type
>(std::abs(gx[i])) + static_cast<intermediate_type>(std::abs(gy[i]));
52 auto sum =
static_cast<uint32_t
>(gx[i] * gx[i]) + static_cast<uint32_t>(gy[i] * gy[i]);
53 val = std::sqrt(
sum) + 0.5f;
DATA_TYPE sum(__global const DATA_TYPE *input)
Calculate sum of a vector.
DataType data_type() const override
Data type of the tensor.
TensorShape shape() const override
Shape of the tensor.
Copyright (c) 2017-2021 Arm Limited.
Simple tensor object that stores elements in a consecutive chunk of memory.
T saturate_cast(T val)
Saturate a value of type T against the numeric limits of type U.
int num_elements() const override
Number of elements of the tensor.
MagnitudeType
Magnitude calculation type.
SimpleTensor< T > magnitude(const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, MagnitudeType magnitude_type)