def writes
bendtorch-core@0.1.0.0 · src/autograd/reduce_replayed_proof.bend:60
import bendtorch-core@0.1.0.0/src/autograd/reduce_replayed_proof.bend as ReduceReplayedProof
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
60def writes(+plan: Shape.BroadcastPlan, +map: PlanMap(plan), +shape: Shape.Shape, +fill: F32, +ops: List<&2, StorageLaws.Op>, +count: Nat) -> List<&2, StorageLaws.Op>:
61 match count:
62 case 0n:
63 Nil{}
64 case 1n+previous:
65 Replayed.snoc(writes(plan, map, shape, fill, ops, previous),
66 StorageLaws.Write{U32.from_nat(previous), cell_word(plan, map, shape, fill, ops, previous)})