def kept_after
bendtorch-core@0.1.0.0 · src/autograd/reduce.bend:220
import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
220
221
222def kept_after(+rows: List<&2, Shape.Row>, +extents: List<&2, Nat>) -> Bool:
223 match rows extents:
224 case Shape.Row{stride, +left, right} <> +rest +extent <> +others:
225 Bool.or(Bool.and(Nat.is_lt(1n, extent), Bool.not(Nat.is_eq(left, 0n))), kept_after(rest, others))
226 case _ _:
227 False{}