init(shape:scalars:)
Creates a tensor with the specified shape and contiguous scalars in first-major order.
Declaration
init(shape: [Int], scalars: some Collection<Float>)Parameters
- shape:
The dimensions of the tensor. The product of the dimensions of the shape must equal the number of scalars.
- scalars:
The scalar contents of the tensor.
See Also
Creating a tensor
init(_:)init(_:alongAxis:)init(_:scalarType:)init(bytesNoCopy:shape:scalarType:deallocator:)init(concatenating:alongAxis:)init(linearSpaceFrom:through:count:)init(linearSpaceFrom:through:count:scalarType:)init(ones:scalarType:)init(randomNormal:mean:standardDeviation:seed:scalarType:)init(randomUniform:in:seed:scalarType:)init(rangeFrom:to:by:)init(rangeFrom:to:by:scalarType:)init(repeating:shape:)init(repeating:shape:scalarType:)init(shape:data:scalarType:)