def sweep
stelliferous@0.0.2.0 · tensor_operations.bend:224
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
import stelliferous@0.0.2.0/proofs/storage_certificate.bend as Certificate
224
225def sweep(~Element: Data,~operation: Element -> Element -> Element,+pad: Element,input: Storage.Buffer<Element>,+sweep: Access.Sweep,+outer: U32,
226 output: Storage.Buffer<Element>) -> Outcome<(Storage.Buffer<Element> & Storage.Buffer<Element>)>:
227 Storage.Buffer{input,+input_length,input_certificate} = input
228 Certificate.Certificate{+input_depth,input_equation} = input_certificate
229 Storage.Buffer{output,+output_length,output_certificate} = output
230 Certificate.Certificate{+output_depth,output_equation} = output_certificate
231 sweep_when(~Element,~operation,sweep_geometry(sweep) && holds(sweep_input(sweep,outer),input_length,U32.shln(1,input_depth)) &&
232 holds(sweep_output(sweep,outer),output_length,U32.shln(1,output_depth)),sweep_output(sweep,outer),Access.SweepContext{sweep,pad},
233 Storage.Buffer{input,input_length,Certificate.Certificate{input_depth,input_equation}},Storage.Buffer{output,output_length,Certificate.Certificate{output_depth,output_equation}})