tensorly.sum

sum(tensor, axis=None)

Compute the sum of a tensor, optionally along an axis.

Parameters
tensortensor
axisint, optional

If provided, the sum is computed along this axis.

Returns
outscalar or tensor