Spec.outer: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/spec.bend as Spec Lines 52-58 of bendtorch@1.3.0.0/spec.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/spec.bend&start_line=52&end_line=58 import Base # g ⊗ v: row i is g[i]·v (a linear layer's weight gradient, dW = dy ⊗ x) def outer(g: List<&2, Nat>, +v: List<&2, Nat>) -> List<&2, List<&2, Nat>>: match g: case Nil{}: Nil{} case Con{gi, gt}: vscale(gi, v) <> outer(gt, v) Uses (3): 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=bendtorch@1.3.0.0/spec.bend&name=vscale