Mojo function
group_norm_reshape
group_norm_reshape[dtype: DType, rank: Int](shape: IndexList[rank, element_type=element_type], buf: LayoutTensor[dtype, layout, origin, address_space=address_space, element_layout=element_layout, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment], channels_per_group: Int, spatial: Int) -> LayoutTensor[dtype, Layout.row_major[2](), 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:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!