class_docstr: Layer normalization (https://arxiv.org/abs/1607.06450). Operates on the last axis of the input data.
class_docstr_tok: ["Layer","normalization","(","https",":","\/\/arxiv.org\/abs\/1607.06450",")",".","Operates","on","the","last","axis","of","the","input","data","."]
docstr: Applies layer normalization on the input. It normalizes the activations of the layer for each given example in
  a batch independently, rather than across a batch like Batch Normalization. i.e. applies a transformation that
  maintains the mean activation within each example close to 0 and the activation standard deviation close to 1
  
  Args:
    x: the inputs
  
  Returns:
    Normalized inputs (the same shape as inputs).
docstr_tok: ["Applies","layer","normalization","on","the","input",".","It","normalizes","the","activations","of","the","layer","for","each","given","example","in","a","batch","independently",",","rather","than","across","a","batch","like","Batch","Normalization",".","i.e",".","applies","a","transformation","that","maintains","the","mean","activation","within","each","example","close","to","0","and","the","activation","standard","deviation","close","to","1","Args",":","x",":","the","inputs","Returns",":","Normalized","inputs","(","the","same","shape","as","inputs",")","."]
code: def __call__(self, x):
      """
      Applies layer normalization on the input. It normalizes the activations of the layer for each given example in
      a batch independently, rather than across a batch like Batch Normalization. i.e. applies a transformation that
      maintains the mean activation within each example close to 0 and the activation standard deviation close to 1
  
      Args:
        x: the inputs
  
      Returns:
        Normalized inputs (the same shape as inputs).
      """
      features = x.shape[-1]
      mean = jnp.mean(x, axis=-1, keepdims=True)
      mean2 = jnp.mean(jax.lax.square(x), axis=-1, keepdims=True)
      var = mean2 - jax.lax.square(mean)
      mul = jax.lax.rsqrt(var + self.epsilon)
      if self.scale:
          mul = mul * jnp.asarray(
              self.param("gamma", self.scale_init, (features,)),
              self.dtype,
          )
      y = (x - mean) * mul
      if self.bias:
          y = y + jnp.asarray(
              self.param("beta", self.bias_init, (features,)),
              self.dtype,
          )
      return y
  
imports: from typing import Callable, Dict, Tuple
  import numpy
  import flax.linen
  import jax
  import jax.numpy
  from jax.random import PRNGKey
  from modeling_flax_performer_utils import make_fast_softmax_attention
  from transformers.file_utils import add_start_docstrings
  from transformers.modeling_flax_utils import ACT2FN
  from transformers.models.bert.configuration_bert import BertConfig
  from transformers.models.bert.modeling_flax_bert import FlaxBertOnlyMLMHead, FlaxBertPreTrainedModel
  from transformers.utils import logging
label_desc: Use image node_id 1 for calling the FlaxPerformerLayerNorm obj's underlying member method code with example usage: obj.__call__(x) and returns: y