---
title: "layerNorm"
sidebar_label: "layerNorm"
description: "Kotlin binding reference: layerNorm."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[layerNorm](layerNorm.md)

# layerNorm

[common]\
fun [layerNorm](layerNorm.md)(input: [Tensor](../Tensor/index.md), normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)

`layerNorm(input: Tensor, normalizedShape: LongArray, weight: Tensor? = null, bias: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `layer_norm` operator. Layer normalization over the trailing `normalized_shape` dims of `input`. Statistics are computed per position over the trailing `normalized_shape` dims (channels-last layout, `[N, .., C]`). The output keeps `input`'s shape AND dtype. An optional `activation` is fused onto the post-affine value (gated kinds are not accepted here).