def allocated
bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise.bend:66
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
66def allocated(~O: Data, ~f: O -> F32 -> F32 -> F32, ~P: Data, ~ia: P -> Nat -> Nat, ~ib: P -> Nat -> Nat,
67 +operation: O, +plan: P, +shape: Shape.Shape, left: Core.Dynamic, right: Core.Dynamic,
68 result: Result<&2, &1, Core.Error, Core.Tensor<shape>>) ->
69 (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic>:
70 match result:
71 case Fail{error}:
72 ((left, right), Fail{error})
73 case Done{output}:
74 loop(~O, ~f, ~P, ~ia, ~ib, Shape.elements(shape), operation, plan, shape, 0n, State{left, right, output})