---
title: "init(rangeFrom:to:by:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mltensor/init(rangefrom:to:by:)"
---

# init(rangeFrom:to:by:)

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

```swift
init(rangeFrom start: Float, to end: Float, by stride: Float.Stride)
```

## 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 never an element of the resulting sequence.
- `stride`: The amount to step by with each iteration. stride must be positive.

## See Also

### Creating a tensor

- [init(_:)](coreml/mltensor/init(_:).md)
- [init(_:alongAxis:)](coreml/mltensor/init(_:alongaxis:).md)
- [init(_:scalarType:)](coreml/mltensor/init(_:scalartype:).md)
- [init(bytesNoCopy:shape:scalarType:deallocator:)](coreml/mltensor/init(bytesnocopy:shape:scalartype:deallocator:).md)
- [init(concatenating:alongAxis:)](coreml/mltensor/init(concatenating:alongaxis:).md)
- [init(linearSpaceFrom:through:count:)](coreml/mltensor/init(linearspacefrom:through:count:).md)
- [init(linearSpaceFrom:through:count:scalarType:)](coreml/mltensor/init(linearspacefrom:through:count:scalartype:).md)
- [init(ones:scalarType:)](coreml/mltensor/init(ones:scalartype:).md)
- [init(randomNormal:mean:standardDeviation:seed:scalarType:)](coreml/mltensor/init(randomnormal:mean:standarddeviation:seed:scalartype:).md)
- [init(randomUniform:in:seed:scalarType:)](coreml/mltensor/init(randomuniform:in:seed:scalartype:).md)
- [init(rangeFrom:to:by:scalarType:)](coreml/mltensor/init(rangefrom:to:by:scalartype:).md)
- [init(repeating:shape:)](coreml/mltensor/init(repeating:shape:).md)
- [init(repeating:shape:scalarType:)](coreml/mltensor/init(repeating:shape:scalartype:).md)
- [init(shape:data:scalarType:)](coreml/mltensor/init(shape:data:scalartype:).md)
- [init(shape:scalars:)](coreml/mltensor/init(shape:scalars:).md)
