TensorFile.read_chunk: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_file.bend as TensorFile Lines 312-318 of stelliferous@0.0.2.0/tensor_file.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_file.bend&start_line=312&end_line=318 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Buffers # The cursor retains the array; only the current chunk becomes a list. def read_chunk(count: Nat,+offset: U32,storage: Array,values: List<&2,F32>) -> Array & List<&2,F32>: match count: case 0n: (storage,List.reverse(&2,F32,values)) case 1n+rest: Buffers.bind_pair(Array,F32,Array & List<&2,F32>,Array.get(F32,storage,offset),storage => value => read_chunk(rest,(offset + 1 : U32),storage,value <> values)) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse 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=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=bind_pair