Method counting
static member counting: ITensorDevice -> int64 -> Tensor<int64>
Creates a new vector filled with the integers from zero to the specified maximum.
Declaration
static member counting: dev:ITensorDevice -> nElems:int64 -> Tensor<int64>
Parameters
Type | Name | Description |
---|---|---|
ITensorDevice | dev | The device to create the tensor on. |
int64 | nElems | The number of elements of the new vector. |
Returns
Type | Description |
---|---|
Tensor<int64> | The new tensor. |
Remarks
A new vector with the specified number of elements is created on the specified device.
The tensor is filled with [0L; 1L; 2L; ...; nElems-1L]
.
Examples
let a = Tensor.counting HostTensor.Dev 5L
// a = [0L; 1L; 2L; 3L; 4L]