def contiguous
bendtorch-core@0.1.0.0 · src/autograd/reduce.bend:229
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
229
230
231
232
233def contiguous(+rows: List<&2, Shape.Row>, +extents: List<&2, Nat>) -> Bool:
234 match rows extents:
235 case Shape.Row{stride, +left, right} <> +rest +extent <> +others:
236 Bool.pick(Bool, Bool.and(Nat.is_lt(1n, extent), Nat.is_eq(left, 0n)), Bool.not(kept_after(rest, others)),
237 contiguous(rest, others))
238 case _ _:
239 True{}