Contents

init(unsafeUninitializedShape:initializingWith:)

Creates a shaped array type from a shape and a closure that initializes its memory.

Declaration

init(unsafeUninitializedShape shape: [Int], initializingWith initializer: (inout UnsafeMutableBufferPointer<Self.Scalar>, [Int]) throws -> Void) rethrows

Parameters

  • shape:

    An integer array. Each element represents the size of the shaped array’s corresponding dimension.

  • initializer:

    A closure you provide that initializes the shaped array’s underlying memory. The initializer calls your closure with a pointer to the memory and an array of strides that correspond to the shaped array’s dimensions.

See Also

Creating a shaped array type