def batched_reduced
bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:566
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
566
567
568
569def batched_reduced(+target: Nat, +shape: Shape.Shape,
570 result: Result<&2, &1, Core.Error, Core.Dynamic & Core.Dynamic & Core.Dynamic>) -> Result<&2, &1, Error, Contribution>:
571 match result:
572 case Fail{error}:
573 Fail{TensorError{error}}
574 case Done{triple}:
575 (first, second, product) = triple
576 contribution_of(reduced(target, shape, product))