TensorBand.range_leaf: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_band.bend as TensorBand Lines 300-308 of stelliferous@0.0.2.0/tensor_band.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_band.bend&start_line=300&end_line=308 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage # Repartition and halo extraction share this owned range reader. Empty # intersections copy zero elements; each source owner is returned unchanged. def range_leaf(~Element: Data,geometry: Geometry,+target_first: U32,+target_rows: U32,target_offset: U32,+first: U32,+rows: U32, source: Storage.Buffer,output: Storage.Buffer) -> Bands(~Element) & Storage.Buffer: Geometry{batch,channels,height,+width} = geometry +begin = U32.max(first,target_first) +end = U32.max(begin,U32.min((first + rows : U32),(target_first + target_rows : U32))) range_result(~Element,first,rows,range_planes(~Element,U32.is_eq(begin,end),channels,((end - begin) * width : U32), (rows * width : U32),(target_rows * width : U32),((begin - first) * width : U32),(target_offset + (begin - target_first) * width : U32),(source,output))) Uses (14): 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=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Bands https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Geometry https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=range_planes https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=range_result