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

Function GetUnpaddedTensorStrides

src/backends/backendsCommon/TensorHandle.cpp:15–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13{
14
15TensorShape GetUnpaddedTensorStrides(const TensorInfo& tensorInfo)
16{
17 TensorShape shape(tensorInfo.GetShape());
18 auto size = GetDataTypeSize(tensorInfo.GetDataType());
19 auto runningSize = size;
20 std::vector<unsigned int> strides(shape.GetNumDimensions());
21 auto lastIdx = shape.GetNumDimensions()-1;
22 for (unsigned int i=0; i < lastIdx ; i++)
23 {
24 strides[lastIdx-i] = runningSize;
25 runningSize *= shape[lastIdx-i];
26 }
27 strides[0] = runningSize;
28 return TensorShape(shape.GetNumDimensions(), strides.data());
29}
30
31ConstTensorHandle::ConstTensorHandle(const TensorInfo& tensorInfo)
32: m_TensorInfo(tensorInfo)

Callers 6

GetStridesMethod · 0.85
GetStridesMethod · 0.85
GetStridesMethod · 0.85
GetStridesMethod · 0.85
GetStridesMethod · 0.85
GetStridesMethod · 0.85

Calls 6

GetDataTypeSizeFunction · 0.85
TensorShapeClass · 0.50
GetShapeMethod · 0.45
GetDataTypeMethod · 0.45
GetNumDimensionsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected