``public struct ShapedArraySlice<Scalar> : _ShapedArrayProtocol``

A contiguous slice of a `ShapedArray` or `ShapedArraySlice` instance.

`ShapedArraySlice` enables fast, efficient operations on contiguous slices of `ShapedArray` instances. `ShapedArraySlice` instances do not have their own storage. Instead, they provides a view onto the storage of their base `ShapedArray`. `ShapedArraySlice` can represent two different kinds of slices: element arrays and subarrays.

Element arrays are subdimensional elements of a `ShapedArray`: their rank is one less than that of their base. Element array slices are obtained by indexing a `ShapedArray` instance with a singular `Int32` index.

For example:

``````let matrix = ShapedArray(shape: [2, 2], scalars: [0, 1, 2, 3])
// `matrix` represents [[0, 1], [2, 3]].

let element = matrix[0]
// `element` is a `ShapedArraySlice` with shape [2]. It is an element
// array, specifically the first element in `matrix`: [0, 1].

matrix[1] = ShapedArraySlice(shape: [2], scalars: [4, 8])
// The second element in `matrix` has been mutated.
// `matrix` now represents [[0, 1, 4, 8]].
``````

Subarrays are a contiguous range of the elements in a `ShapedArray`. The rank of a subarray is the same as that of its base, but its leading dimension is the count of the slice range. Subarray slices are obtained by indexing a `ShapedArray` with a `Range<Int32>` that represents a range of elements (in the leading dimension). Methods like `prefix(:)` and `suffix(:)` that internally index with a range also produce subarray.

For example:

``````let zeros = ShapedArray(shape: [3, 2], repeating: 0)
var matrix = ShapedArray(shape: [3, 2], scalars: Array(0..<6))
// `zeros` represents [[0, 0], [0, 0], [0, 0]].
// `matrix` represents [[0, 1], [2, 3], [4, 5]].

let subarray = matrix.prefix(2)
// `subarray` is a `ShapedArraySlice` with shape [2, 2]. It is a slice
// of the first 2 elements in `matrix` and represents [[0, 1], [2, 3]].

matrix[0..<2] = zeros.prefix(2)
// The first 2 elements in `matrix` have been mutated.
// `matrix` now represents [[0, 0], [0, 0], [4, 5]].
``````
• ``` rank ```

#### Declaration

``var rank: Int { get }``
• ``` shape ```

#### Declaration

``var shape: [Int] { get }``
• ``` scalarCount ```

#### Declaration

``var scalarCount: Int { get }``
• ``` init(shape:scalars:) ```

#### Declaration

``init(shape: [Int], scalars: [Scalar])``
• ``` init(shape:scalars:) ```

#### Declaration

``init<S>(shape: [Int], scalars: S) where Scalar == S.Element, S : Sequence``
• ``` init(_:) ```

Creates a `ShapedArraySlice` from a scalar value.

#### Declaration

``init(_ scalar: Scalar)``
• ``` init(shape:repeating:) ```

Creates a `ShapedArraySlice` with the specified shape and a single, repeated value.

#### Declaration

``init(shape: [Int], repeating repeatedValue: Scalar)``

#### Parameters

 ``` shape ``` The dimensions of the array. ``` repeatedValue ``` The scalar value to repeat.
• ``` withUnsafeBufferPointer(_:) ```

#### Declaration

``````func withUnsafeBufferPointer<Result>(
_ body: (UnsafeBufferPointer<Scalar>) throws -> Result
) rethrows -> Result``````
• ``` withUnsafeMutableBufferPointer(_:) ```

#### Declaration

``````mutating func withUnsafeMutableBufferPointer<Result>(
_ body: (inout UnsafeMutableBufferPointer<Scalar>) throws -> Result
) rethrows -> Result``````
• ``` Index ```

#### Declaration

``public typealias Index = Int``
• ``` Element ```

#### Declaration

``public typealias Element = ShapedArraySlice``
• ``` SubSequence ```

#### Declaration

``public typealias SubSequence = ShapedArraySlice``
• ``` indices ```

#### Declaration

``public var indices: Range<Int> { get }``
• ``` startIndex ```

#### Declaration

``public var startIndex: Int { get }``
• ``` endIndex ```

#### Declaration

``public var endIndex: Int { get }``
• ``` subscript(_:) ```

Access the element array specified by an index in the leading dimension.

#### Declaration

``public subscript(index: Int) -> Element { get set }``

#### Parameters

 ``` index ``` Index of the element array.
• ``` subscript(_:) ```

Access the subarray specified by a contiguous range of indices.

#### Declaration

``public subscript(bounds: Range<Int>) -> SubSequence { get set }``

#### Parameters

 ``` bounds ``` Contiguous range of indices.
• ``` init(_:) ```

#### Declaration

``init(_ tensor: Tensor<Scalar>)``
• ``` ArrayLiteralElement ```

#### Declaration

``public typealias ArrayLiteralElement = TensorElementLiteral<Scalar>``
• ``` init(arrayLiteral:) ```

#### Declaration

``public init(arrayLiteral elements: TensorElementLiteral<Scalar>...)``
• ``` ==(_:_:) ```

#### Declaration

``public static func == (lhs: ShapedArraySlice, rhs: ShapedArraySlice) -> Bool``
• ``` description ```

A textual representation of this `ShapedArraySlice`.

#### Declaration

``public var description: String { get }``
• ``` playgroundDescription ```

#### Declaration

``public var playgroundDescription: Any { get }``
• ``` customMirror ```

#### Declaration

``public var customMirror: Mirror { get }``