def nt_left

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

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix

373# g @ W for the left operand of x @ W^T: g and W are copied first, so a
374# failure loses neither.
375def nt_left(+target: Nat, +shape: Shape.Shape, copy: Core.Dynamic, pair: Core.Dynamic & Core.Dynamic) ->
376  Core.Dynamic & Result<&2, &1, Error, Contribution>:
377  (right, flipped) = pair
378  (right, multiplied(target, shape, Matrix.matmul(copy, flipped)))

Uses (10)

Used by (2)