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

Function SetupConcatViewOrigin

delegate/common/src/DelegateUtils.hpp:193–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void SetupConcatViewOrigin(const armnn::TensorInfo& inputTensorInfo,
194 armnn::OriginsDescriptor& concatDescriptor,
195 const unsigned int concatAxis,
196 unsigned int inputIndex,
197 unsigned int& mergeDimOrigin)
198{
199 const uint32_t inputRank = concatDescriptor.GetNumDimensions();
200
201 // double check dimensions of the tensors
202 if (inputTensorInfo.GetNumDimensions() != inputRank)
203 {
204 throw armnn::ParseException("The number of dimensions for input tensors "
205 "of the concatenation operator should be: " + std::to_string(inputRank));
206 }
207
208 for (unsigned int j = 0; j < concatAxis; ++j)
209 {
210 concatDescriptor.SetViewOriginCoord(inputIndex, j, 0);
211 }
212
213 concatDescriptor.SetViewOriginCoord(inputIndex, concatAxis, mergeDimOrigin);
214 mergeDimOrigin += inputTensorInfo.GetShape()[concatAxis];
215
216 for (unsigned int j = concatAxis + 1; j < inputRank; ++j)
217 {
218 concatDescriptor.SetViewOriginCoord(inputIndex, j, 0);
219 }
220}
221
222TfLiteStatus CreateOutputTensorShape(const armnn::TensorInfo& inputTensorInfo,
223 const std::vector<int32_t>& targetShape,

Callers 2

Calls 5

ParseExceptionClass · 0.85
SetViewOriginCoordMethod · 0.80
to_stringFunction · 0.50
GetNumDimensionsMethod · 0.45
GetShapeMethod · 0.45

Tested by

no test coverage detected