Calculates the sum of a tensor along a given axis, or all entries if no axis is specified.
The tensor
Optional
An axis less than the rank, removed from the result, while omitting it reduces all entries to a number
const result = Chalkboard.tens.sum([[1, 2, 3], [4, 5, 6]], 0); // Returns [5, 7, 9] Copy
const result = Chalkboard.tens.sum([[1, 2, 3], [4, 5, 6]], 0); // Returns [5, 7, 9]
Calculates the sum of a tensor along a given axis, or all entries if no axis is specified.