def pair_zeros

bendtorch@1.3.0.0 · main.bend:811

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base

811# dump and load for a pair of layers: the first layer's numbers, then the second's
812# a pair's zeros, the two halves in a parallel let: a model's gradient and optimizer state are many arrays, and making
813# them one after another left the training state's zeroing (page faults, mostly) on one thread
814def pair_zeros(~P1: Type, ~X1: Type, ~Y1: Type, ~S1: Type, ~P2: Type, ~X2: Type, ~Y2: Type, ~S2: Type, ~la: Layer<P1, X1, Y1, S1>, ~lb: Layer<P2, X2, Y2, S2>) -> Two<P1, P2>:
815  a b = Layer.zeros(P1, X1, Y1, S1, la) Layer.zeros(P2, X2, Y2, S2, lb)
816  Two{a, b}

Uses (3)

Used by (4)