<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSGraph/Builder/SliceRange",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate9BNNSGraphO7BuilderV10SliceRangeV"
  },
  "title" : "BNNSGraph.Builder.SliceRange"
}
-->

# BNNSGraph.Builder.SliceRange

A structure that represents a range.

```
struct SliceRange
```

## Overview

You can use standard Swift range operators to specify the range in slice operation. However,
the `BNNSGraph.Builder.SliceRange` structure provides additional functionality:

- You can specify a `stop` that’s less that the `start` value.
- You can supply negative `startIndex` and `endIndex` values to indicate the index is relative to
  the end of sequence
- You can specify the stride.
- You can specify an `UnboundedRange` with the `fillAll` constant.

For example, the following code shows a slice operation that selects dimensions using a
`SliceRange`, a Swift range, and an integer.

```
    let slice = src[BNNSGraph.Builder.SliceRange(startIndex: 1,
                                                 endIndex: -1),
                    5 ... 20,
                    3]
```

## Topics

### Initializers

[`init(startIndex: Int, endIndex: Int)`](/documentation/Accelerate/BNNSGraph/Builder/SliceRange/init(startIndex:endIndex:))

Returns a new slice range structure.

### Instance Properties

[`let endIndex: Int`](/documentation/Accelerate/BNNSGraph/Builder/SliceRange/endIndex)

[`let startIndex: Int`](/documentation/Accelerate/BNNSGraph/Builder/SliceRange/startIndex)

### Type Properties

[`static let fillAll: BNNSGraph.Builder.SliceRange`](/documentation/Accelerate/BNNSGraph/Builder/SliceRange/fillAll)

The same as the ellipsis literal `...` used to indicate unspecified dimensions of the tensor.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`SliceIndex`](/documentation/Accelerate/BNNSGraph/Builder/SliceIndex)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)