def reduce
stelliferous@0.0.2.0 · tensor_operations.bend:281
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_view.bend as Views
import stelliferous@0.0.2.0/proofs/storage_certificate.bend as Certificate
281def reduce(~Element: Data,~Accumulator: Data,~operation: Accumulator -> Element -> Accumulator,
282 buffer: Storage.Buffer<Element>,+view: Views.View,initial: Accumulator) -> Outcome<(Storage.Buffer<Element> & Accumulator)>:
283 Storage.Buffer{storage,+length,certificate} = buffer
284 Certificate.Certificate{+depth,equation} = certificate
285 reduce_when(~Element,~Accumulator,~operation,valid_buffer(length,U32.shln(1,depth),view),Views.numel(view),view,
286 Storage.Buffer{storage,length,Certificate.Certificate{depth,equation}},initial)