def sweep_when
stelliferous@0.0.2.0 · tensor_operations.bend:203
import stelliferous@0.0.2.0/tensor_operations.bend as TensorOperations
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/tensor_access.bend as Access
203def sweep_when(~Element: Data,~operation: Element -> Element -> Element,valid: Bool,count: Maybe<&2,U32>,+context: Access.SweepContext<Element>,
204 input: Storage.Buffer<Element>,output: Storage.Buffer<Element>) -> Outcome<(Storage.Buffer<Element> & Storage.Buffer<Element>)>:
205 match valid count:
206 case True{} Some{count}: Accepted{swept(~Element,~operation,U32.to_nat(count),context,input,output)}
207 case valid count: Rejected{(input,output)}