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

Method GetStartForAxis

src/armnn/Descriptors.cpp:393–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393int StridedSliceDescriptor::GetStartForAxis(const TensorShape& inputShape,
394 unsigned int axis) const
395{
396 int start = m_Begin[axis];
397
398 if (m_BeginMask & (1 << axis))
399 {
400 if (m_Stride[axis] > 0)
401 {
402 start = std::numeric_limits<int>::min();
403 }
404 else
405 {
406 start = std::numeric_limits<int>::max();
407 }
408 }
409
410 const int axisSize = armnn::numeric_cast<int>(inputShape[axis]);
411 if (start < 0)
412 {
413 start += (axisSize);
414 }
415
416 return std::max(0, std::min(start, axisSize - 1));
417
418}
419
420int StridedSliceDescriptor::GetStopForAxis(const TensorShape& inputShape,
421 unsigned int axis,

Callers 3

StridedSliceFunction · 0.80
InferOutputShapesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected