def targets_fit
import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Lossimport Base
261# Whether every target is below `columns`, and there are `rows` of them.
262def targets_fit(+targets: List<&2, U32>, +rows: Nat, +columns: Nat) -> Bool:
263 match targets rows:
264 case Nil{} 0n:
265 True{}
266 case Con{+target, +rest} 1n+below:
267 Bool.and(Nat.is_lt(U32.to_nat(target), columns), targets_fit(rest, below, columns))
268 case _ _:
269 False{}