TensorAccess.last_of_run: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_access.bend as TensorAccess Lines 8-18 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=8&end_line=18 import Base import stelliferous@0.0.2.0/traversal_array.bend as Traversal import stelliferous@0.0.2.0/tensor_cursor.bend as Cursor # A strided operation visits the source view in row-major order. It proceeds # in runs of the innermost axis: every element of a run but the last advances # only the address, and the last takes the ordinary cursor step, which carries # into the outer axes. The element loop is a small native loop whatever else # shares the cursor; stepping the whole cursor per element costs several calls # with a wide state once more than one operation uses it. inside and last are # the same element action, stepping a stride and the whole cursor. def last_of_run(~Element: Data,extent: Nat,stride: U32,rewind: U32,rest: Cursor.Depth1(), state: Traversal.State<&1,&1,Array,Array,Cursor.Stride>) -> Traversal.State<&1,&1,Array,Array,Cursor.Cursor>: Traversal.State{input,output,position,Cursor.Stride{address,step}} = state Traversal.State{input,output,position,Cursor.Cursor{Cursor.Level{Cursor.Axis{extent,1n,stride,rewind},rest},address}} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=Axis 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=Depth1 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=Level https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_cursor.bend&name=Stride https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_array.bend&name=State