def left_padded

bendtorch-core@0.1.0.0 · src/shape/projection_proofs.bend:118

import bendtorch-core@0.1.0.0/src/shape/projection_proofs.bend as ProjectionProofs
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/broadcast_proofs.bend as Broadcast

118def left_padded(+left: List<&2, Nat>, +right: List<&2, Nat>, +output: List<&2, Nat>, +alignment: Shape.Broadcast<left, right, output>) -> {List.length(&2, Nat, Shape.pad(Nat.sub(List.length(&2, Nat, output), List.length(&2, Nat, left)), left)) == List.length(&2, Nat, output) : Nat}:
119  match alignment:
120    case Shape.BAlign{+lp, +rp, minimal, +aligned}:
121      +width = Broadcast.aligned_length_left(Shape.pad(lp, left), Shape.pad(rp, right), output, aligned)
122      %padding_of(List.length(&2, Nat, output), lp, List.length(&2, Nat, left), Equal.trans(Nat, Nat.add(lp, List.length(&2, Nat, left)), List.length(&2, Nat, Shape.pad(lp, left)), List.length(&2, Nat, output), Broadcast.pad_length(lp, left), width)) : {List.length(&2, Nat, Shape.pad(_, left)) == List.length(&2, Nat, output) : Nat}
123      width

Uses (11)

Used by (1)