| 43 | } |
| 44 | |
| 45 | TensorDescriptor ReorgLayerNode::compute_output_descriptor(const TensorDescriptor &input_descriptor, int stride) |
| 46 | { |
| 47 | const unsigned int input_width = get_dimension_size(input_descriptor, DataLayoutDimension::WIDTH); |
| 48 | const unsigned int input_height = get_dimension_size(input_descriptor, DataLayoutDimension::HEIGHT); |
| 49 | const unsigned int input_channel = get_dimension_size(input_descriptor, DataLayoutDimension::CHANNEL); |
| 50 | |
| 51 | ARM_COMPUTE_ERROR_ON(stride <= 0); |
| 52 | ARM_COMPUTE_ERROR_ON_MSG((input_width % stride != 0), "The width of the input tensor must be a multiple of stride"); |
| 53 | ARM_COMPUTE_ERROR_ON_MSG((input_height % stride != 0), |
| 54 | "The height of the input tensor must be a multiple of stride"); |
| 55 | |
| 56 | const DataLayout data_layout = input_descriptor.layout; |
| 57 | TensorDescriptor output_descriptor = input_descriptor; |
| 58 | output_descriptor.shape.set(get_dimension_idx(data_layout, DataLayoutDimension::WIDTH), input_width / stride); |
| 59 | output_descriptor.shape.set(get_dimension_idx(data_layout, DataLayoutDimension::HEIGHT), input_height / stride); |
| 60 | output_descriptor.shape.set(get_dimension_idx(data_layout, DataLayoutDimension::CHANNEL), |
| 61 | input_channel * stride * stride); |
| 62 | |
| 63 | return output_descriptor; |
| 64 | } |
| 65 | |
| 66 | bool ReorgLayerNode::forward_descriptors() |
| 67 | { |
nothing calls this directly
no test coverage detected