Method arange
static member arange: ITensorDevice -> 'T -> 'T -> 'T -> Tensor<'T>
Creates a new vector filled with equaly spaced values using a specifed increment.
Declaration
static member arange: dev:ITensorDevice -> start:'T -> incr:'T -> stop:'T -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
ITensorDevice | dev | The device to create the tensor on. |
'T | start | The starting value. |
'T | incr | The increment between successive element. |
'T | stop | The end value, which is not included. |
Returns
Type | Description |
---|---|
Tensor<'T> | The new tensor. |
Remarks
A new vector with floor ((stop - start) / incr)
elements is created on the specified device.
The vector is filled with [start; start+1incr; start+2incr; ...]
.
If stop is smaller or equal to start, an empty vector is returned.
Examples
let a = Tensor.arange HostTensor.Dev 1.0 0.1 2.0
// a = [1.0; 1.1; 1.2; 1.3; 1.4; 1.5; 1.6; 1.7; 1.8; 1.9]