sum edit page

sum of a list of tensors

Syntax

T = sum(T)     % sum along the first non singleton dimension
T = sum(T,dim) % sum along dimension dim

Input

T tensor
dim dimension with respect to which the sum is taken