Contents

init(zeros:scalarType:)

Creates a tensor with all scalars set to zero.

Declaration

init<Scalar>(zeros shape: [Int], scalarType: Scalar.Type = Scalar.self) where Scalar : MLTensorScalar, Scalar : BinaryFloatingPoint, Scalar.RawSignificand : FixedWidthInteger

Parameters

  • shape:

    The shape of the tensor.

  • scalarType:

    The scalar type.

See Also

Creating a tensor