def write_step
bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise.bend:14
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise.bend as Pointwise
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
14def write_step(-shape: Shape.Shape,
15 rec: State<shape> -> (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>,
16 left: Core.Dynamic, right: Core.Dynamic, pair: Core.Tensor<shape> & Result<&2, &2, Core.Error, Unit>) ->
17 (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>:
18 (output, result) = pair
19 match result:
20 case Fail{error}:
21 ((left, right), Fail{error})
22 case Done{unit}:
23 rec(State{left, right, output})