import mir.ndslice.topology: map, byDim; import mir.ndslice.slice: sliced; auto ar = [[1, 2, 3], [10, 20, 30]]; assert(ar.map!sliced.sumSlices == [11, 22, 33]); import mir.ndslice.fuse: fuse; auto a = [[[1.2], [2.1]], [[4.1], [5.2]]].fuse; auto s = a.byDim!0.sumSlices; assert(s == [[5.3], [7.300000000000001]]);
Sum slices with a naive algorithm.