class_docstr: Transposed LayerNorm module.
  
  LayerNorm module over second dimension
  Assumes shape (B, D, L), where L can be 1 or more axis
  
  This is slow and a dedicated CUDA/Triton implementation
  shuld provide substantial end-to-end speedup
code: def forward(self, x):
      if self.scalar:
          # calc. stats over D dim / channels
          s, m = torch.std_mean(x, dim=1, unbiased=False, keepdim=True)
          y = (self.s / s) * (x - m + self.m)
      else:
          # move channel to last axis, apply layer_norm,
          # then move channel back to second axis
          _x = self.ln(rearrange(x, "b d ... -> b ... d"))
          y = rearrange(_x, "b ... d -> b d ...")
      return y
  
imports: import math
  from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from opt_einsum import contract
label_desc: Use image node_id 2 for calling the TransposedLN obj's underlying member method code with example usage: obj.forward(x) and returns: y