Skip to content
tmpl

sum_broadcast_runs

void sum_broadcast_runs()

Add a full-shape grad back onto dst, shaped as the plan's source.

Parameters

planconst BroadcastPlan&
From plan_broadcast.
gradconst T*
outer * inner * rep elements, contiguous.
dstT*
The source-shaped accumulator; added to, not overwritten.

Notes

Every destination receives its contributions in increasing output order — the order an element-by-element walk uses — so a float sum is the same bits it always was; a vectorised or pairwise sum would not be.