39 const unsigned int width,
40 const unsigned int height)
49 #pragma omp parallel for 51 for(uint32_t element_idx = 0; element_idx < num_elements; ++element_idx)
55 dst[element_idx] =
saturate_cast<T>(tensor_elem_at<int32_t>(
sum, id, border_mode, constant_border_value) / static_cast<int>(scale));
62 const unsigned int widht,
const unsigned int height);
64 const unsigned int widht,
const unsigned int height);
BorderMode
Methods available to handle borders.
void apply_2d_spatial_filter(Coordinates coord, const SimpleTensor< T > &src, SimpleTensor< U > &dst, const TensorShape &filter_shape, const V *filter_itr, double scale, BorderMode border_mode, T constant_border_value=T(0))
DATA_TYPE sum(__global const DATA_TYPE *input)
Calculate sum of a vector.
#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.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
SimpleTensor< T > convolution(const SimpleTensor< uint8_t > &src, DataType output_data_type, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value, const unsigned int width, const unsigned int height)
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.
SimpleTensor< T > scale(const SimpleTensor< T > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
DataType
Available data types.