Tensor.pad: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/tensor.bend as Tensor Lines 60-62 of bendtorch@1.3.0.0/tensor.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/tensor.bend&start_line=60&end_line=62 import Base # s aligned to rank r by leading size-1 axes, as broadcasting aligns shapes from the right def pad(+s: List<&2, Nat>, +r: Nat) -> List<&2, Nat>: ones_then(Nat.sub(r, List.length(&2, Nat, s)), s) 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=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/tensor.bend&name=ones_then