Skip to content
class

AxisScatterWalk

AxisScatterWalk

Where an axis scatter's writes land in base.

The walk is over the index's extents, which may be shorter than base's on any axis but dim (src arrives cut to the index's shape), so each outer (before dim) and inner (after) coordinate of the index is placed by base's strides. When the shapes agree this is (o * base_dim + tgt) * inner + j exactly. Index and src are dense in the index's shape: element (o, k, j) is at (o * idx_dim + k) * inner + j.