TensorPlay
API symbolssparse
Copy
View MarkdownDownload .md

tensorplay.sparse.sum

tensorplay.sparse.sum(input, dim=None, dtype=None)[source]

Sum of input’s values over dim.

Mirrors torch.sparse.sum: with no dim (or an empty list) the result is a dense 0-dim tensor; reducing every sparse dim yields a dense tensor; a partial reduction returns a coalesced sparse COO tensor over the remaining dims with duplicate coordinates folded. dtype converts the input first, acting as the accumulation type.

Ask DeepWiki