def divided
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signedimport Base
177def divided(+extents: List<&2, Extent>, split: Nat & Nat) -> Result<&2, &2, Error, List<&2, U32>>:
178 (quotient, remainder) = split
179 match remainder:
180 case 0n:
181 Done{filled(extents, U32.from_nat(quotient))}
182 case 1n+rest:
183 Fail{count_mismatch()}