Python wrappers
Public Python APIs implemented by this engine symbol.Reduce a by addition along axes.
Promotes bool / int8 / int16 / int32 inputs to
int64 before dispatch so the sum has overflow headroom matching
the reference framework. Routes the forward through
SumBackward which also installs the autograd edge when
a->requires_grad() is true.
See Also
SumBackward — backward node.
Parameters
aTensorImplPtrInput tensor of any shape and any real dtype.
axesstd::vector<int>Axes to reduce. May be empty to reduce all axes. Negative indices wrap around
ndim.keepdimsboolIf
true, the reduced dimensions are kept as size-1 entries; otherwise they are collapsed.Returns
TensorImplPtrOutput tensor. Shape is the input shape with the reduced axes either removed (default) or set to (keepdims=true).