class_docstr: LayerNorm optimized for Apple Neural Engine (ANE) execution
  
  Note: This layer only supports normalization over the final dim. It expects `num_channels`
  as an argument and not `normalized_shape` which is used by `torch.nn.LayerNorm`.
class_docstr_tok: ["LayerNorm","optimized","for","Apple","Neural","Engine","(","ANE",")","execution","Note",":","This","layer","only","supports","normalization","over","the","final","dim",".","It","expects","`","num_channels","`","as","an","argument","and","not","`","normalized_shape","`","which","is","used","by","`","torch.nn.LayerNorm","`","."]
docstr: Args:
      num_channels:       Number of channels (C) where the expected input data format is BC1S. S stands for sequence length.
      clip_mag:           Optional float value to use for clamping the input range before layer norm is applied.
                          If specified, helps reduce risk of overflow.
      eps:                Small value to avoid dividing by zero
      elementwise_affine: If true, adds learnable channel-wise shift (bias) and scale (weight) parameters
docstr_tok: ["Args",":","num_channels",":","Number","of","channels","(","C",")","where","the","expected","input","data","format","is","BC1S",".","S","stands","for","sequence","length",".","clip_mag",":","Optional","float","value","to","use","for","clamping","the","input","range","before","layer","norm","is","applied",".","If","specified",",","helps","reduce","risk","of","overflow",".","eps",":","Small","value","to","avoid","dividing","by","zero","elementwise_affine",":","If","true",",","adds","learnable","channel-wise","shift","(","bias",")","and","scale","(","weight",")","parameters"]
code: def __init__(
      self,
      num_channels,
      clip_mag=None,
      eps=1e-5,
      elementwise_affine=True,
  ):
      """
      Args:
          num_channels:       Number of channels (C) where the expected input data format is BC1S. S stands for sequence length.
          clip_mag:           Optional float value to use for clamping the input range before layer norm is applied.
                              If specified, helps reduce risk of overflow.
          eps:                Small value to avoid dividing by zero
          elementwise_affine: If true, adds learnable channel-wise shift (bias) and scale (weight) parameters
      """
      super().__init__()
      # Principle 1: Picking the Right Data Format (machinelearning.apple.com/research/apple-neural-engine)
      self.expected_rank = len("BC1S")
  
      self.num_channels = num_channels
      self.eps = eps
      self.clip_mag = clip_mag
      self.elementwise_affine = elementwise_affine
  
      if self.elementwise_affine:
          self.weight = nn.Parameter(torch.Tensor(num_channels))
          self.bias = nn.Parameter(torch.Tensor(num_channels))
  
      self._reset_parameters()
  
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new LayerNormANE object from inherited base classes: nn with example: obj = LayerNormANE(num_channels, clip_mag, eps, elementwise_affine)