43 const std::array<int8_t, 9> scharr_3_x{ { -3, 0, 3, -10, 0, 10, -3, 0, 3 } };
44 const std::array<int8_t, 9> scharr_3_y{ { -3, -10, -3, 0, 0, 0, 3, 10, 3 } };
46 const std::map<int, std::pair<const int8_t *, const int8_t *>> masks
48 { 3, { scharr_3_x.data(), scharr_3_y.data() } }
61 template <
typename T,
typename U>
64 const auto shape_size =
static_cast<unsigned int>(
filter_size);
80 switch(gradient_dimension)
82 case GradientDimension::GRAD_X:
85 case GradientDimension::GRAD_Y:
97 return std::make_pair(dst_x, dst_y);
BorderMode
Methods available to handle borders.
Container for 2D border size.
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))
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
std::pair< SimpleTensor< T >, SimpleTensor< T > > scharr(const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
TensorShape shape() const override
Shape of the tensor.
This file contains all available output stages for GEMMLowp on OpenCL.
bool is_in_valid_region(const ValidRegion &valid_region, Coordinates coord)
Check if a coordinate is within a valid region.
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
1 channel, 1 S16 per channel
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_channels() const override
Number of channels of the tensor.
x and y gradient dimension
Borders are left undefined.
int num_elements() const override
Number of elements of the tensor.
DataType
Available data types.
GradientDimension
Gradient dimension type.
convolution configure & src
ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
Create a valid region based on tensor shape, border mode and border size.