def Shaped
bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise_proof.bend:248
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_proof.bend as PointwiseProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise.bend as Pointwise
248def Shaped(~O: Data, ~f: O -> F32 -> F32 -> F32, ~P: Data, ~ia: P -> Nat -> Nat, ~ib: P -> Nat -> Nat,
249 +fuel: Nat, +operation: O, +plan: P, +left: Shape.Shape, +right: Shape.Shape, +shape: Shape.Shape, +cursor: Nat,
250 -left_storage: Storage.Storage, -right_storage: Storage.Storage, -output_storage: Storage.Storage,
251 -Q: (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic> -> Type) -> Type:
252 @-left_fits: {Lifecycle.logical_length(left_storage) == Shape.logical_numel(Shape.dimensions(left)) : Nat} ->
253 @-right_fits: {Lifecycle.logical_length(right_storage) == Shape.logical_numel(Shape.dimensions(right)) : Nat} ->
254 @-output_fits: {Lifecycle.logical_length(output_storage) == Shape.logical_numel(Shape.dimensions(shape)) : Nat} ->
255 Q(Pointwise.loop(~O, ~f, ~P, ~ia, ~ib, fuel, operation, plan, shape, cursor,
256 Pointwise.State{Core.Packed{left, Core.TTensor{left_storage, left_fits}}, Core.Packed{right, Core.TTensor{right_storage, right_fits}},
257 Core.TTensor{output_storage, output_fits}}))