Show / Hide Table of Contents

    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]
    See Also
    static member counting: ITensorDevice -> int64 -> Tensor<int64>
    val linspace: 'T -> 'T -> int64 -> Tensor<'T>
    Back to top Generated by DocFX