Skip to main content

Mojo function

group_norm_reshape

group_norm_reshape[dtype: DType, rank: Int](shape: IndexList[rank, element_type=element_type], buf: TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], channels_per_group: Int, spatial: Int) -> TileTensor[dtype, Layout[RuntimeInt[DType.int64], RuntimeInt[DType.int64], RuntimeInt[DType.int64], RuntimeInt[DType.int64]], origin, address_space=address_space]

Reshapes an input buffer for group normalization by flattening all dimensions except the group dimension. Returns a 2D buffer of shape (num_groups * N, group_size), where group_size is the product of channels_per_group and spatial.

Returns:

TileTensor

Was this page helpful?