Contents

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