| 123 | { |
| 124 | |
| 125 | armnn::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 | |
| 146 | armnn::TensorInfo TransposeTensorShape(const armnn::TensorInfo& info, const armnn::PermutationVector& mappings) |
| 147 | { |
no test coverage detected