Skip to main content

scan

Function scan 

Source
pub fn scan<B: Backend, C: Tree<B>, X: Tree<B>, Y: Tree<B>>(
    f: impl Fn(C, X) -> (C, Y),
    init: C,
    xs: X,
    length: usize,
) -> (C, Y)
Expand description

A loop over the leading dimension of the arrays of xs: returns the final carry and the outputs stacked along a new leading dimension (lax.scan). length must match the leading dimension of xs (and is the number of iterations when xs has no arrays).