TensorAccess.reduce_run: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_access.bend as TensorAccess Lines 109-119 of stelliferous@0.0.2.0/tensor_access.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_access.bend&start_line=109&end_line=119 import Base import stelliferous@0.0.2.0/tensor_view.bend as Views import stelliferous@0.0.2.0/traversal_array.bend as Traversal import stelliferous@0.0.2.0/tensor_cursor.bend as Cursor def reduce_run(~Element: Data,~Accumulator: Data,~operation: Accumulator -> Element -> Accumulator, fast: Bool,count: Nat,view: Views.View,storage: Array,initial: Accumulator) -> Array & Accumulator: match fast: case True{}: Views.View{axes,offset} = view Traversal.fold(~Array,~Element,~Accumulator,~Traversal.Offsets,~Traversal.source_offset(~Element),~operation, count,0,storage,initial,Traversal.Offsets{offset,0}) case False{}: Traversal.finish_fold(~Array,~Accumulator,~Cursor.Cursor, Traversal.visit_fold(~Array,~Element,~Accumulator,~Cursor.Cursor,~Cursor.read(~Element),~operation,count, Traversal.State{storage,initial,0,Cursor.prepare(view)})) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=Cursor https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=prepare https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=read https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=View https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=Offsets https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=State https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=finish_fold https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=fold https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=source_offset https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=visit_fold