def batched_left

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

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/batched_matmul.bend as Batched

600# g @ right^T for the left operand, from copies of g and of the saved right
601# operand, so a failure loses neither.
602def batched_left(+a: Nat, +left: Shape.Shape, +plan: Batched.Plan, copy: Core.Dynamic, pair: Core.Dynamic & Core.Dynamic) ->
603  Core.Dynamic & Result<&2, &1, Error, Contribution>:
604  (y, right_copy) = pair
605  (y, batched_reduced(a, left, Batched.left_gradient(plan, copy, right_copy)))

Uses (11)

Used by (1)