| 391 | } |
| 392 | |
| 393 | int 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 | |
| 420 | int StridedSliceDescriptor::GetStopForAxis(const TensorShape& inputShape, |
| 421 | unsigned int axis, |
no outgoing calls
no test coverage detected