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

Function ProcessConcatInputTensorInfo

src/armnnUtils/ParserHelper.cpp:19–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17const armnn::PermutationVector ArmNNToNHWC = { 0, 3, 1, 2 };
18
19void ProcessConcatInputTensorInfo(armnn::TensorInfo& inputTensorInfo,
20 armnn::OriginsDescriptor& concatDescriptor,
21 const unsigned int& concatAxis,
22 unsigned int inputIndex,
23 unsigned int& mergeDimOrigin)
24{
25 const uint32_t inputRank = concatDescriptor.GetNumDimensions();
26
27 // double check dimensions of the tensors
28 if (inputTensorInfo.GetNumDimensions() != inputRank)
29 {
30 throw armnn::ParseException(fmt::format(
31 "The number of dimensions: {0} for input tensors of the "
32 "concatenation op should be {1} {2}",
33 inputTensorInfo.GetNumDimensions(),
34 inputRank,
35 CHECK_LOCATION().AsString()));
36 }
37
38 for (unsigned int j = 0; j < concatAxis; ++j)
39 {
40 concatDescriptor.SetViewOriginCoord(inputIndex, j, 0);
41 }
42
43 concatDescriptor.SetViewOriginCoord(inputIndex, concatAxis, mergeDimOrigin);
44 mergeDimOrigin += inputTensorInfo.GetShape()[concatAxis];
45
46 for (unsigned int j = concatAxis + 1; j < inputRank; ++j)
47 {
48 concatDescriptor.SetViewOriginCoord(inputIndex, j, 0);
49 }
50}
51
52void CalculateReducedOutputTensoInfo(const armnn::TensorInfo& inputTensorInfo,
53 const std::set<unsigned int>& axisSet,

Callers 2

ParseConcatMethod · 0.85
ParseConcatenationMethod · 0.85

Calls 6

ParseExceptionClass · 0.85
formatEnum · 0.85
SetViewOriginCoordMethod · 0.80
GetNumDimensionsMethod · 0.45
AsStringMethod · 0.45
GetShapeMethod · 0.45

Tested by

no test coverage detected