Strides, almost always hidden

The commit that names the work: strides should be explicit when needed, but almost always hidden. Until now every initCpu made you pass {3,1} for a {2,3} like you were the library. createStridesFromShape walks the shape backwards, last dimension stride 1, product growing toward the left. init(allocator, shape) zeros a CPU tensor and does that for you. initWithFill is the same with a value. initWithStrides is the escape hatch: layout, device, initial bytes, optional fill.

The afternoon is the usual mess. Buggered and broken. Moving in strides. Whoops. Then own strides. ops.add calls initWithStrides now, because it is copying layout from its inputs. HEAD is 2753cfa. The tensor finally owns a layout it can hide.

0e5ef81 · eef687d · 9290d9d · 922b278 · 2753cfa

Previous