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

Method GetStopForAxis

src/armnn/Descriptors.cpp:420–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420int StridedSliceDescriptor::GetStopForAxis(const TensorShape& inputShape,
421 unsigned int axis,
422 int startForAxis) const
423{
424
425 if (m_ShrinkAxisMask & (1 << axis))
426 {
427 return startForAxis + 1;
428 }
429
430 int stop = m_End[axis];
431
432 if (m_EndMask & (1 << axis))
433 {
434 if (m_Stride[axis] > 0)
435 {
436 stop = std::numeric_limits<int>::max();
437 }
438 else
439 {
440 stop = std::numeric_limits<int>::min();
441 }
442 }
443
444 const int axisSize = armnn::numeric_cast<int>(inputShape[axis]);
445 if (stop < 0)
446 {
447 stop += axisSize;
448 }
449
450 return m_Stride[axis] > 0 ? std::max(0, std::min(stop, axisSize)) :
451 std::max(-1, std::min(stop, axisSize - 1));
452
453}
454
455uint32_t GetNumInputs(bool biasEnabled)
456{

Callers 3

StridedSliceFunction · 0.80
InferOutputShapesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected