Show / Hide Table of Contents

    Method sumAxis

    static member sumAxis: int -> Tensor<'T> -> Tensor<'T>

    Sums the elements along the specified axis.

    Declaration
    static member sumAxis: ax:int -> src:Tensor<'T> -> Tensor<'T>
    Parameters
    Type Name Description
    int ax

    The axis to sum along.

    Tensor<'T> src

    The tensor containing the source values.

    Returns
    Type Description
    Tensor<'T>

    A new tensor containing the result of this operation.

    Remarks

    Elements are summed along the specified axis. An empty sum equals zero.

    Examples
     let a = HostTensor.ofList2D [[1.0; 2.0; 3.0; 4.0]
                                  [5.0; 6.0; 7.0; 8.0]]
     let b = Tensor.sumAxis 1 a // b = [10.0; 26.0]
    See Also
    member FillSumAxis: int -> Tensor<'T> -> unit
    static member sum: Tensor<'T> -> 'T
    Back to top Generated by DocFX