Skip to main content

Mojo function

layer_norm

layer_norm[dtype: DType, rank: Int, input_0_fn: fn[Int, Int](IndexList[$1]) capturing -> SIMD[dtype, $0], input_1_fn: fn[Int, Int](IndexList[$1]) capturing -> SIMD[dtype, $0], output_0_fn: fn[Int, Int, Int](idx: IndexList[$1], val: SIMD[dtype, $0]) capturing -> None, /, target: StringSlice[StaticConstantOrigin] = "cpu"](shape: IndexList[rank], gamma_shape: IndexList[1], beta: 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], epsilon: Scalar[dtype], ctx: DeviceContextPtr)

Was this page helpful?