41 const std::array<T, 9> filter{ { 1, 1, 1, 1, 1, 1, 1, 1, 1 } };
42 const float scale = 1.f /
static_cast<float>(filter.size());
45 #pragma omp parallel for 47 for(uint32_t element_idx = 0; element_idx < num_elements; ++element_idx)
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))
DataType data_type() const override
Data type of the tensor.
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.
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_elements() const override
Number of elements of the tensor.
SimpleTensor< T > box3x3(const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
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)