Mojo function
pack_filter
pack_filter(filter: NDBuffer[dtype, rank, origin, shape, strides, alignment2=alignment2, address_space=address_space, exclusive=exclusive], packed_filter: NDBuffer[dtype, rank, origin, shape, strides, alignment2=alignment2, address_space=address_space, exclusive=exclusive], num_groups: Int)
This packs the filter form RSCF to FRSCf. Use the default micro kernel size for dynamic shapes.
pack_filter[simd_size: Int, micro_kernel_f_size: Int](filter: NDBuffer[dtype, rank, origin, shape, strides, alignment2=alignment2, address_space=address_space, exclusive=exclusive], packed_filter: NDBuffer[dtype, rank, origin, shape, strides, alignment2=alignment2, address_space=address_space, exclusive=exclusive], num_groups: Int)
This packs the filter form RSCF to FRSCf.
F is first broken down to segments of size micro_kernel_f_size, then the remainder is further divided by simd_size. The last residual elements if any is padded with zero to fill simd_size.
Parameters:
- simd_size (Int): Can differ from the simd size of the input type.
- micro_kernel_f_size (Int): The size of the last dimension in FRSCf, which is equals the size of the micro kernel's F dimension.
Args:
- filter (NDBuffer): Filter in RSCF layout (if 2D).
- packed_filter (NDBuffer): Packed filter in FRSCf layout (if 2D). F - the index of continuous segments in micro kernel. R, S, C - original R, S, C. f - the index within a continuous segments.
- num_groups (Int): The number of groups in the convolution.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
