Core.numel_words: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/shape/core.bend as Core Lines 392-400 of bendtorch-core@0.1.0.0/src/shape/core.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&start_line=392&end_line=400 import Base # numel_words, horner and digits_words run on checked coordinates or below a # nonzero element count only: every extent is then at least 1, so each product # is at most the shape's element count. def numel_words(dims: List<&2, U32>) -> Nat: match dims: case Nil{}: 1n case head <> tail: Nat.mul(U32.to_nat(head), numel_words(tail)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat