Skip to main content

Mojo function

pack_filter_from_fcrs

pack_filter_from_fcrs(filter: TileTensor[filter.dtype, filter.LayoutType, filter.origin, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type, element_size=filter.element_size], packed_filter: TileTensor[packed_filter.dtype, packed_filter.LayoutType, packed_filter.origin, address_space=packed_filter.address_space, linear_idx_type=packed_filter.linear_idx_type, element_size=packed_filter.element_size], num_groups: Int)

This packs the filter from FCRS to FRSCf (2D) or FCQRS to FQRSCf (3D).

The filter arrives with its actual dtype (e.g., float32). We transpose FCRS→RSCF in a temp buffer using the actual dtype, then create an int64- reinterpreted TileTensor for pack_filter (which expects int64).

Args:

  • filter (TileTensor): Filter TileTensor with actual element dtype in FCRS layout.
  • packed_filter (TileTensor): Output TileTensor with int64 dtype (for pack_filter).
  • num_groups (Int): Number of groups in the convolution.

Was this page helpful?