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

Function get_dimension_idx

src/graph/Utils.cpp:150–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150size_t get_dimension_idx(DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
151{
152 ARM_COMPUTE_ERROR_ON_MSG(data_layout == DataLayout::UNKNOWN,
153 "Cannot retrieve the dimension index for an unknown layout!");
154
155 /* Return the index based on the data layout
156 * [N C H W]
157 * [3 2 1 0]
158 * [N H W C]
159 */
160 switch (data_layout_dimension)
161 {
162 case DataLayoutDimension::CHANNEL:
163 return (data_layout == DataLayout::NCHW) ? 2 : 0;
164 break;
165 case DataLayoutDimension::HEIGHT:
166 return (data_layout == DataLayout::NCHW) ? 1 : 2;
167 break;
168 case DataLayoutDimension::WIDTH:
169 return (data_layout == DataLayout::NCHW) ? 0 : 1;
170 break;
171 case DataLayoutDimension::BATCHES:
172 return 3;
173 break;
174 default:
175 break;
176 }
177 ARM_COMPUTE_ERROR("Data layout index not supported!");
178}
179
180std::vector<NodeIdxPair> get_driving_nodes(const INode &node)
181{

Calls

no outgoing calls

Tested by

no test coverage detected