TensorBand.global_index: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_band.bend as TensorBand Lines 33-38 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=33&end_line=38 import Base # Channel-major local indices map to the same global NCHW index for every # partition. A leaf's first row is global across images; rows are image-local. def global_index(geometry: Geometry,+first: U32,+rows: U32,+index: U32) -> U32: Geometry{batch,+channels,+height,+width} = geometry +plane = (rows * width : U32) (((first / height * channels + index / plane) * height + first % height) * width + index % plane : U32) Uses (6): 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.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Geometry