One Logo Pool Ball
CoreML · IOS API REFERENCE

MLShapedArrayProtocol

protocol · iOS 15.0+ · SDK 27.1

protocol MLShapedArrayProtocol<Scalar> : ExpressibleByArrayLiteral, MutableCollection, RandomAccessCollection where Self.Index == Int

Protocol for the shaped array and the slice of shaped array.

Members (8)

get · iOS 15.0+

scalarCount

Swift declaration
var scalarCount: Int { get }

The number of scalars in the shaped array.

get · iOS 15.0+

count

Swift declaration
var count: Int { get }

The number of elements in the first axis

get · iOS 15.0+

scalar

Swift declaration
var scalar: Self.Scalar? { get set }

Scalar value The getter returns `nil` if `!isScalar`.

get · iOS 15.0+

scalars

Swift declaration
var scalars: [Self.Scalar] { get set }

Flatten representation of scalars in first-major order.

get · iOS 15.0+

isScalar

Swift declaration
var isScalar: Bool { get }

True if the shaped array is a rank-0 primitive value. For example, given a shaped array `m` of shape `[2, 2]`, `m[0, 1]` represents a scalar located at row 0 and column 1.

subscript · iOS 15.0+

subscript

Swift declaration
subscript(index: Int) -> MLShapedArraySlice<Self.Scalar> { get set }
subscript · iOS 15.0+

subscript

Swift declaration
subscript(sliceRange: Range<Int>) -> MLShapedArraySlice<Self.Scalar> { get set }

A slice of the shaped array for the specified ranges. This overrides the method from Collection.

subscript · iOS 15.0+

subscript

Swift declaration
subscript(_: (UnboundedRange_) -> Void) -> MLShapedArraySlice<Self.Scalar> { get set }

Skipped declarations

22 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

MLShapedArrayProtocol.subscript(_:)

The iOS SDK compiler rejected this binding: cannot access associated type 'Scalar' from 'MLShapedArrayProtocol'; use a concrete type or generic parameter base instead

MLShapedArrayProtocol.subscript(_:)

A variable number of Swift arguments is not supported.

MLShapedArrayProtocol.subscript(_:)

The iOS SDK compiler rejected this binding: member 'subscript' cannot be used on value of type 'any MLShapedArrayProtocol'; consider using a generic constraint instead [#ExistentialMemberAccess]

MLShapedArrayProtocol.subscript(_:)

A variable number of Swift arguments is not supported.

MLShapedArrayProtocol.subscript(scalarAt:)

A variable number of Swift arguments is not supported.

MLShapedArrayProtocol.scalars

The iOS SDK compiler rejected this binding: cannot assign to property: 'o' is a 'let' constant

MLShapedArrayProtocol.scalar

The iOS SDK compiler rejected this binding: cannot assign to property: 'o' is a 'let' constant

MLShapedArrayProtocol.fill(with:)

The iOS SDK compiler rejected this binding: cannot access associated type 'Scalar' from 'MLShapedArrayProtocol'; use a concrete type or generic parameter base instead

MLShapedArrayProtocol.fill(with:)

This declaration needs Swift generic type arguments. (no canonical witness for C)

MLShapedArrayProtocol.index(after:)

The iOS SDK compiler rejected this binding: ambiguous type name 'Index' in 'MLShapedArrayProtocol'

MLShapedArrayProtocol.index(_:offsetBy:)

The iOS SDK compiler rejected this binding: ambiguous type name 'Index' in 'MLShapedArrayProtocol'

MLShapedArrayProtocol.init(identityMatrixOfSize:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(randomScalarsIn:shape:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(identityMatrixOfSize:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(randomScalarsIn:shape:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

MLShapedArrayProtocol.init(repeating:shape:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(scalars:shape:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

MLShapedArrayProtocol.init(bytesNoCopy:shape:deallocator:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(converting:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(_:)

A protocol cannot be constructed directly.

MLShapedArrayProtocol.init(converting:)

A protocol cannot be constructed directly.

All CoreML types →