Contents

init(linearSpaceFrom:through:count:scalarType:)

Creates a one-dimensional tensor representing a sequence from a starting value, up to and including an end value, spaced evenly to generate the number of values specified.

Declaration

init<Scalar>(linearSpaceFrom start: Scalar, through end: Scalar, count: Int, scalarType: Scalar.Type = Scalar.self) where Scalar : MLTensorScalar, Scalar : BinaryFloatingPoint

Parameters

  • start:

    The starting value to use for the sequence. If the sequence contains any values, the first one is start.

  • end:

    An end value to limit the sequence. end is the last element of the resulting sequence.

  • count:

    The number of values in the resulting sequence. count must be greater than 1.

  • scalarType:

    The scalar type.

See Also

Creating a tensor