Function sum

  • Calculates the sum of tensor elements along an axis.

    Parameters

    • t: Tensor

      the input tensor

    • Optional axis: number | number[]

      (optional) the axis to sum along

    Returns Tensor

    the sum