BNNSGraph.Builder.SliceRange
A structure that represents a range.
Declaration
struct SliceRangeOverview
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
stopthat’s less that thestartvalue.You can supply negative
startIndexandendIndexvalues to indicate the index is relative to the end of sequenceYou can specify the stride.
You can specify an
UnboundedRangewith thefillAllconstant.
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]