42 const int stride_x = info.
stride().first;
43 const int stride_y = info.
stride().second;
45 int out_x = src.
shape().x() + (src.
shape().x() - 1) * (stride_x - 1) + a.first + 2 * info.
pad().first;
46 int out_y = src.
shape().y() + (src.
shape().y() - 1) * (stride_y - 1) + a.second + 2 * info.
pad().second;
47 scaled_shape.
set(0, out_x);
48 scaled_shape.
set(1, out_y);
51 const int width_in = src.
shape().x();
52 const int height_in = src.
shape().y();
53 const int width_scaled = scaled.shape().x();
54 const int height_scaled = scaled.shape().y();
55 const int num_2d_slices = src.
shape().total_size() / (width_in * height_in);
56 const int ax = a.first;
57 const int ay = a.second;
63 for(
int j = 0; j < scaled.num_elements(); ++j)
68 for(
int slice = 0; slice < num_2d_slices; ++slice)
70 const int offset_slice_in = slice * width_in * height_in;
71 const int offset_slice_out = slice * width_scaled * height_scaled;
72 const int start_x = info.
pad().first;
73 const int start_y = ay + info.
pad().second;
74 const int end_y = height_scaled - info.
pad().second;
75 const int end_x = width_scaled - ax - info.
pad().first;
77 for(
int yi = start_y, in_y = 0; yi < end_y; yi += stride_y, in_y++)
79 for(
int xi = start_x, in_x = 0; xi < end_x; xi += stride_x, in_x++)
81 const T *in = src.
data() + offset_slice_in + in_y * width_in + in_x;
82 T *out = scaled.data() + offset_slice_out + xi + yi * width_scaled;
std::pair< unsigned int, unsigned int > pad() const
Get the padding.
SimpleTensor< T > convolution_layer(const SimpleTensor< T > &src, const SimpleTensor< T > &weights, const SimpleTensor< TB > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation)
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.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
const T * data() const
Constant pointer to the underlying buffer.
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
Padding and stride information class.
Simple tensor object that stores elements in a consecutive chunk of memory.
SimpleTensor< T > deconvolution_layer(const SimpleTensor< T > &src, const SimpleTensor< T > &weights, const SimpleTensor< T > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const std::pair< unsigned int, unsigned int > &a)
Deconvolution reference implementation.
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true)
Accessor to set the value of one of the dimensions.
int fixed_point_position() const override
Number of bits for the fractional part.
convolution configure & src
#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)