MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / compute_output_descriptor

Method compute_output_descriptor

src/graph/nodes/ReorgLayerNode.cpp:45–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45TensorDescriptor 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
66bool ReorgLayerNode::forward_descriptors()
67{

Callers

nothing calls this directly

Calls 3

get_dimension_sizeFunction · 0.85
get_dimension_idxFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected