One Logo Pool Ball
Accelerate · IOS API REFERENCE

BNNS.Shape

enum · iOS 14.0+ · SDK 27.1

enum Shape

An enumeration that describes the number of dimensions, the length of each dimension, the data layout, and the stride of an n-dimensional array.

Members (6)

get · iOS 14.0+

batchStride

TypeScript
get batchStride(): number
Swift declaration
var batchStride: Int { get }

The increment, in values, between each batch of values.

get · iOS 14.0+

rank

TypeScript
get rank(): number
Swift declaration
var rank: Int { get }

The number of dimensions.

get · iOS 14.0+

size

TypeScript
get size(): [number, number, number, number, number, number, number, number]
Swift declaration
var size: (Int, Int, Int, Int, Int, Int, Int, Int) { get }

The size of each dimension.

get · iOS 14.0+

layout

TypeScript
get layout(): BNNSDataLayout
Swift declaration
var layout: BNNSDataLayout { get }

The data layout.

get · iOS 14.0+

stride

TypeScript
get stride(): [number, number, number, number, number, number, number, number]
Swift declaration
var stride: (Int, Int, Int, Int, Int, Int, Int, Int) { get }

The stride of each dimension.

init · iOS 14.0+

init

TypeScript
static init(size: Array<number>, dataLayout?: (BNNS_DataLayout) | null, stride?: (Array<number>) | null): BNNS_Shape
Swift declaration
init(_ size: [Int], dataLayout: BNNS.DataLayout? = nil, stride: [Int]? = nil)

Creates a new shape from the specified size, layout and stride. - Parameter size: An array specifying the number of values in each dimension. - Parameter dataLayout: The dimension of the array, and how the data is stored. - Parameter stride: An array specifying the increment, in values, between a value and the next in each dimension. When `nil`, `stride` is initialized with zeros of count `rank`, indicating that values are contiguous for all axes. Pass `nil` to `dataLayout` to have `Shape.init(size:dataLayout:stride:)` return a shape with the default data layout for the dimension count that's equal to the number of elements in the `size` array. The default layouts for each dimensionality are: * 1D: `.vector` * 2D: `.matrixFirstMajor` * 3D: `.tensor3DFirstMajor` * 4D: `.tensor4DFirstMajor` * 5D: `.tensor5DFirstMajor` * 6D: `.tensor6DFirstMajor` * 7D: `.tensor7DFirstMajor` * 8D: `.tensor8DFirstMajor` A stride value of 0 is interpreted to mean that values are contiguous for that axis.

Skipped declarations

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

BNNS.Shape.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

All Accelerate types →