44 const int M = src.
shape()[0];
45 const int N = src.
shape()[1];
46 const int num_channels = src.
shape()[2];
47 const int batches = src.
shape()[3];
48 const int MxN = M * N;
49 const int channels_in_group = num_channels / num_groups;
51 const T *src_ref = src.
data();
52 T *dst_ref =
dst.data();
54 for(
int n = 0; n < batches; ++n)
56 for(
int g = 0; g < num_groups; ++g)
60 const T *src_ptr = src_ref + g * channels_in_group * MxN + n * num_channels * MxN;
61 T *dst_ptr = dst_ref + g * MxN + n * num_channels * MxN;
62 for(
int i = 0; i < channels_in_group; ++i)
65 src_ptr + (i + 1) * MxN,
66 dst_ptr + i * num_groups * MxN);
DataType data_type() const override
Data type of the tensor.
SimpleTensor< T > channel_shuffle(const SimpleTensor< T > &src, int num_groups)
TensorShape shape() const override
Shape of the tensor.
SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)
This file contains all available output stages for GEMMLowp on OpenCL.
const T * data() const
Constant pointer to the underlying buffer.
Simple tensor object that stores elements in a consecutive chunk of memory.
int num_channels() const override
Number of channels of the tensor.
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
int fixed_point_position() const override
Number of bits for the fractional part.
convolution configure & src