def at1

bendtorch@1.3.0.0 · tensor.bend:32

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

32# size of axis k (1 past the last axis, so a missing axis counts as a size-1 one)
33def at1(s: List<&2, Nat>, k: Nat) -> Nat:
34  match s k:
35    case Nil{} _:
36      1n
37    case Con{h, t} 0n:
38      h
39    case Con{h, t} 1n+p:
40      at1(t, p)

Uses (2)

Used by (11)