Tensor.setd: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/tensor.bend as Tensor Lines 293-301 of bendtorch@1.3.0.0/tensor.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/tensor.bend&start_line=293&end_line=301 import Base # s with the size of axis k replaced by v (s itself past the last axis) def setd(s: List<&2, Nat>, k: Nat, +v: Nat) -> List<&2, Nat>: match s k: case Nil{} _: Nil{} case Con{h, t} 0n: v <> t case Con{h, t} 1n+p: h <> setd(t, p, v) Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat