torch:slice
(torch:slice a specs)
Differentiable numpy basic slicing (linalg:slice: one spec per axis -- nil leaves the axis whole, (start end) / (start end step) selects along it, negative indexing and steps included). The backward pass scatters the gradient back into zeros at the positions the slice read from.