def pack

stelliferous@0.0.2.0 · kernel_spatial_packing.bend:163

import stelliferous@0.0.2.0/kernel_spatial_packing.bend as KernelSpatialPacking
import Base
import stelliferous@0.0.2.0/traversal_loop.bend as Loop
import stelliferous@0.0.2.0/kernel_tile.bend as Tile

163# count entries, inner per tile, from output position start.
164def pack(count: Nat,start: U32,input: Array<F32>,output: Array<Tile.Tile8>,height: U32,width: U32,+kernel: U32,stride: U32,padding: U32,output_width: U32,
165  +inner: U32) -> Array<F32> & Array<Tile.Tile8>:
166  finish(Loop.run(~Tiled(),~tile_step,Nat.div(count,U32.to_nat(inner)),
167    Tiles{input,output,0,start,height,width,kernel,stride,padding,output_width,U32.to_nat((inner / (kernel * kernel) : U32)),U32.to_nat(kernel),U32.to_nat(inner)}))

Uses (15)

Used by (2)