def linear

bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:1336

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
import Base

1336# Linear: records x @ W^T with W of [out, in], PyTorch's layout, then adds
1337# the bias b of [out] to every row. The id is the sum's; the product is the
1338# entry before it. The bias id is checked against the tape the call receives,
1339# before the product is recorded, so the product's own id never stands in
1340# for a missing bias. A refusal of any step (an unknown id, a product or a
1341# sum the tensor layer refuses) comes back with its error and the tape as it
1342# was.
1343def linear(tape: Tape, +x: Nat, +w: Nat, +bias: Nat) -> Tape & Result<&2, &2, Error, Nat>:
1344  Tape{entries} = tape
1345  linear_counted(x, w, bias, counted(entries))

Uses (7)

Used by (0)

No other definition uses this definition.