KernelPackingSamples.pixel: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/kernel_packing_samples.bend as KernelPackingSamples Lines 16-20 of stelliferous@0.0.2.0/kernel_packing_samples.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/kernel_packing_samples.bend&start_line=16&end_line=20 import Base def pixel(input_storage: Array, +output_position: U32, +reduction_index: U32, +input_height: U32, +input_width: U32, +kernel_size: U32, +stride: U32, +padding: U32, +output_width: U32) -> Array & F32: +input_row = ((output_position / output_width) * stride + (reduction_index / kernel_size) % kernel_size - padding : U32) +input_column = ((output_position % output_width) * stride + reduction_index % kernel_size - padding : U32) at = ((reduction_index / (kernel_size * kernel_size)) * input_height * input_width + input_row * input_width + input_column : U32) mask_pixel(U32.is_lt(input_row, input_height) && U32.is_lt(input_column, input_width), Array.get(F32, input_storage, at)) Uses (13): 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=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair 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.is_lt 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=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_packing_samples.bend&name=mask_pixel