MCPcopy Create free account
hub / github.com/ARM-software/armnn / TransposeTensorShape

Function TransposeTensorShape

src/armnnUtils/Transpose.cpp:125–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123{
124
125armnn::TensorShape TransposeTensorShape(const armnn::TensorShape& srcShape, const armnn::PermutationVector& mappings)
126{
127 if (srcShape.GetNumDimensions() != mappings.GetSize())
128 {
129 std::stringstream msg;
130 msg << "Transpose: Number of shape dimensions (" << srcShape.GetNumDimensions() <<
131 ") does not match the size of the mappings (" << mappings.GetSize() << ")";
132 throw armnn::InvalidArgumentException(msg.str());
133 }
134
135 const unsigned int numDims = mappings.GetSize();
136 unsigned int outDims[armnn::MaxNumOfTensorDimensions];
137
138 for (unsigned int i = 0U; i < numDims; ++i)
139 {
140 outDims[i] = srcShape[mappings[i]];
141 }
142 armnn::TensorShape permutedShape(numDims, outDims);
143 return permutedShape;
144}
145
146armnn::TensorInfo TransposeTensorShape(const armnn::TensorInfo& info, const armnn::PermutationVector& mappings)
147{

Callers 2

RunMethod · 0.85
InferOutputShapesMethod · 0.85

Calls 6

SetShapeMethod · 0.80
GetNumDimensionsMethod · 0.45
GetSizeMethod · 0.45
strMethod · 0.45
GetShapeMethod · 0.45

Tested by

no test coverage detected