def total
bendtorch-core@0.1.0.0 · src/tensor/contracts/fold.bend:82
import bendtorch-core@0.1.0.0/src/tensor/contracts/fold.bend as Fold
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
82def total(~O: Data, ~g: O -> F32 -> F32 -> F32, ~P: Data, ~ia: P -> Nat -> Nat, ~keep: P -> Nat -> Bool,
83 +operation: O, +plan: P, +shape: Shape.Shape, +fill: F32, +ops: List<&2, StorageLaws.Op>, +count: Nat) -> F32:
84 match count:
85 case 0n:
86 0.0
87 case 1n+previous:
88 chosen(~O, ~g, operation, keep(plan, previous), total(~O, ~g, ~P, ~ia, ~keep, operation, plan, shape, fill, ops, previous),
89 Replayed.value(shape, fill, ops, U32.from_nat(ia(plan, previous))))