def delivered_as

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

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/autograd/reduce.bend as Reduce

178def delivered_as(+target: Nat, +shape: Shape.Shape, pair: Core.Dynamic & Result<&2, &1, Reduce.Error, Core.Dynamic>) ->
179  Core.Dynamic & Result<&2, &1, Error, Contribution>:
180  (owner, result) = pair
181  match result:
182    case Fail{error}:
183      (owner, Fail{ReduceError{error}})
184    case Done{reduced}:
185      (owner, Done{Contribution{target, shape, reduced}})

Uses (9)

Used by (7)