def padding_right

bendtorch-core@0.1.0.0 · src/autograd/reduce_parallel_proof.bend:43

import bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend as ReduceParallelProof
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
import bendtorch-core@0.1.0.0/src/shape/projection_proofs.bend as ShapeProjection

43def padding_right(+left: List<&2, Nat>, +right: List<&2, Nat>, +output: List<&2, Nat>, +lp: Nat, +rp: Nat,
44  +aligned: Shape.Aligned(Shape.pad(lp, left), Shape.pad(rp, right), output)) ->
45  {rp == Nat.sub(List.length(&2, Nat, output), List.length(&2, Nat, right)) : Nat}:
46  ShapeProjection.padding_of(List.length(&2, Nat, output), rp, List.length(&2, Nat, right),
47    Equal.trans(Nat, Nat.add(rp, List.length(&2, Nat, right)), List.length(&2, Nat, Shape.pad(rp, right)), List.length(&2, Nat, output),
48      Broadcast.pad_length(rp, right), Broadcast.aligned_length_right(Shape.pad(lp, left), Shape.pad(rp, right), output, aligned)))

Uses (11)

Used by (1)