Contents

subscript(_:)

A slice of the shaped array for the selected leading axes.

Declaration

subscript<C>(indices: C) -> MLShapedArraySlice<Self.Scalar> where C : Collection, C.Element == Int { get set }

Parameters

  • indices:

    The indices to slice the array.

Overview

The slice has a rank of self.rank - indices.count. For example, given a shaped array m with the shape being 3 x 3, m[[1]] returns a slice of shape [3] with the contents labeld as x below.

 O  O  O
 x  x  x
 O  O  O

See Also

Accessing elements