49 const unsigned int W =
dst.shape().x();
50 const unsigned int H =
dst.shape().y();
51 const unsigned int C =
dst.shape().z();
52 const unsigned int out_c = C / (stride * stride);
53 const unsigned int outer_dims =
dst.shape().total_size() / (W * H * C);
59 #pragma omp parallel for private(map_coords) 61 for(
unsigned int b = 0;
b < outer_dims; ++
b)
64 for(
unsigned int c = 0; c < C; ++c)
66 map_coords.
set(2, c % out_c);
67 const unsigned int offset = c / out_c;
68 for(
unsigned int h = 0; h < H; ++h)
70 map_coords.
set(1, h * stride + offset / stride);
71 for(
unsigned int w = 0;
w < W; ++
w)
73 const unsigned int dst_idx =
w + W * (h + H * (c + C *
b));
74 map_coords.
set(0,
w * stride + offset % stride);
75 dst[dst_idx] = *
reinterpret_cast<const T *
>(
src(map_coords));
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
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.
SimpleTensor< T > reorg_layer(const SimpleTensor< T > &src, int32_t stride)
TensorShape compute_reorg_output_shape(const ITensorInfo &input, int32_t stride)
Calculate the output shape of the reorg layer given a stride.
TensorShape shape() const override
Shape of the tensor.
SimpleTensor< float > src
Copyright (c) 2017-2022 Arm Limited.
DataLayout data_layout() const override
Data layout of the tensor.
Num samples, channels, height, width.
Simple tensor object that stores elements in a consecutive chunk of memory.
Store the tensor's metadata.