init(unsafeUninitializedShape:initializingWith:)
Creates a shaped array slice from a shape and a closure that initializes its memory.
Declaration
init(unsafeUninitializedShape shape: [Int], initializingWith initializer: (inout UnsafeMutableBufferPointer<Scalar>, [Int]) throws -> Void) rethrowsParameters
- 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.