sum

fun sum(a: Tensor<*, *>, dim: Int? = null): Tensor<*, *>(source)

Sum all elements, or sum along a dimension if dim is specified.