Spec.mtv: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/spec.bend as Spec Lines 44-50 of bendtorch@1.3.0.0/spec.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/spec.bend&start_line=44&end_line=50 import Base # Mᵀ·g: the rows weighted by g and summed (a linear layer's backward pass to its input, dx = Wᵀ·dy) def mtv(rows: List<&2, List<&2, Nat>>, g: List<&2, Nat>) -> List<&2, Nat>: match rows g: case Con{r, rt} Con{gi, gt}: vadd(vscale(gi, r), mtv(rt, gt)) case _ _: Nil{} Uses (4): 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=vadd https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/spec.bend&name=vscale