def left_step
bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise.bend:36
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
36def left_step(~O: Data, ~f: O -> F32 -> F32 -> F32, +operation: O, -shape: Shape.Shape, +index: U32, +right_index: U32,
37 rec: State<shape> -> (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>,
38 right: Core.Dynamic, output: Core.Tensor<shape>, pair: Core.Dynamic & Result<&2, &2, Core.Error, F32>) ->
39 (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>:
40 (left, result) = pair
41 match result:
42 case Fail{error}:
43 ((left, right), Fail{error})
44 case Done{x}:
45 right_step(~O, ~f, operation, shape, index, rec, left, output, x, Core.read_dynamic(right, right_index))