init(rangeFrom:to:by:scalarType:)
Creates a one-dimensional tensor representing a sequence from a starting value to, but not including, an end value, stepping by the specified amount.
Declaration
init<Scalar>(rangeFrom start: Scalar, to end: Scalar, by stride: Scalar.Stride, scalarType: Scalar.Type = Scalar.self) where Scalar : MLTensorScalar, Scalar : StrideableParameters
- 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.
endis never an element of the resulting sequence. - stride:
The amount to step by with each iteration.
stridemust be positive. - scalarType:
The scalar type.
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(repeating:shape:)init(repeating:shape:scalarType:)init(shape:data:scalarType:)init(shape:scalars:)