Hi,
In general Tensors with a very large number of dimensions are not as efficient. Cuda will limit you to 25 dimensions if I recall correctly. And on cpu, you might hit slowdowns.
But to answer your question, sum does expect a list/tuple and does not accept a generator (what range returns).