41 template < typename T1, typename T2, typename std::enable_if < std::is_integral<T1>::value &&!std::is_same<T1, T2>::value,
int >
::type >
50 #pragma omp parallel for 54 result[i] = src[i] << shift;
61 #pragma omp parallel for 65 T1 val = src[i] >> shift;
72 template < typename T1, typename T2, typename std::enable_if < is_floating_point<T1>::value &&(!std::is_same<T1, T2>::value &&!std::is_same<T2, bfloat16>::value),
int >::
type >
79 if(!std::is_same<T2, bfloat16>::value && !is_floating_point<T2>::value)
92 result[i] =
static_cast<T2
>(src[i]);
98 template < typename T1, typename T2, typename std::enable_if < std::is_same<T1, bfloat16>::value || std::is_same<T2, bfloat16>::value,
int >
::type >
107 result[i] =
static_cast<T2
>(src[i]);
size_t element_size_from_data_type(DataType dt)
The size in bytes of the data type.
DataType data_type() const override
Data type of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
TensorShape shape() const override
Shape of the tensor.
T round_half_away_from_zero(T value)
Round floating-point value with half value rounding away from zero.
decltype(strategy::transforms) typedef type
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
SimpleTensor< T2 > depth_convert(const SimpleTensor< T1 > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_elements() const override
Number of elements of the tensor.
DataType
Available data types.
ConvertPolicy
Policy to handle overflow.