def right_padded

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

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

125def right_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, right)), right)) == List.length(&2, Nat, output) : Nat}:
126  match alignment:
127    case Shape.BAlign{+lp, +rp, minimal, +aligned}:
128      +width = Broadcast.aligned_length_right(Shape.pad(lp, left), Shape.pad(rp, right), output, aligned)
129      %padding_of(List.length(&2, Nat, output), rp, List.length(&2, Nat, right), Equal.trans(Nat, Nat.add(rp, List.length(&2, Nat, right)), List.length(&2, Nat, Shape.pad(rp, right)), List.length(&2, Nat, output), Broadcast.pad_length(rp, right), width)) : {List.length(&2, Nat, Shape.pad(_, right)) == List.length(&2, Nat, output) : Nat}
130      width

Uses (11)

Used by (1)