IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

group_norm_cpu

def group_norm_cpu[dtype: DType, rank: Int, //, InputFn: def[width: Int](Coord[*?]) -> SIMD[dtype, width] & RegisterPassable & ImplicitlyCopyable, GammaFn: def[width: Int](Coord[*?]) -> SIMD[dtype, width] & RegisterPassable & ImplicitlyCopyable, BetaFn: def[width: Int](Coord[*?]) -> SIMD[dtype, width] & RegisterPassable & ImplicitlyCopyable](input_fn: InputFn, gamma_fn: GammaFn, beta_fn: BetaFn, shape: Coord, epsilon: Float32, output: TileTensor[dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], num_groups: Int, ctx: Optional[DeviceContext] = None)

Computes group normalization on CPU.

Reduces a single-pass Welford mean/variance over each (batch, group) block of channels_per_group * spatial elements, then applies the per-channel gamma/beta affine transform. Parallelizes across N * num_groups blocks.

Parameters:

Args:

Was this page helpful?