Learn Before
Concept
Non-Reduction Tensor Summation
Sometimes it is useful to keep the number of axes unchanged when calculating the sum or mean of a tensor. A non-reduction sum calculates the total along a specified axis but retains that axis with a size of in the output shape, rather than completely eliminating the dimension. Maintaining the original number of axes is critical when the resulting tensor will be used in subsequent mathematical operations that rely on the broadcasting mechanism.
0
1
Updated 2026-05-02
Tags
D2L
Dive into Deep Learning @ D2L