public sum(axes as IList<Long>, keepDims as Boolean = false, where as Boolean[] = null, ignoreNaN as Boolean = false, result as NDArray<T> = null) as NDArray<T>
Sum over several axes, preserving the source numeric element type. Floating types accumulate in Double before one final storage conversion. Integer arithmetic follows the ordinary fixed-width sum contract.
| Parameter | Description |
|---|---|
axes | Distinct positive/negative axes to reduce. |
keepDims | Retain reduced axes with length one. |
where | Optional flat Boolean selection mask. |
ignoreNaN | Skip NaNs; otherwise propagate them for floating input. |
result | Optional non-aliased output tensor of the expected shape/type. |
Reduced tensor; an all-masked slice has sum zero.
totals = data.sum(axes=[0l, 2l], keepDims=true)