Contents

BNNSGraph.Builder.SliceRange

A structure that represents a range.

Declaration

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

Instance Properties

Type Properties