def narrow_ok

bendtorch@1.3.0.0 · tensor.bend:533

import bendtorch@1.3.0.0/tensor.bend as Tensor
import Base

533# axis d exists and start + len fits in it
534def narrow_ok(+s: List<&2, Nat>, +d: Nat, +st: Nat, +l: Nat) -> Bool:
535  Bool.and(Nat.is_lt(d, rank(s)), Nat.is_le(Nat.add(st, l), at1(s, d)))

Uses (9)

Used by (1)