code: def forward(self, x: torch.Tensor):
      # at the beginning of `PLForecastingModule.forward()`, `x` has shape
      # (batch_size, input_chunk_length, n_targets).
      # select all dimensions except batch and input_dim (0, -1)
      # TL;DR: calculate mean and variance over all dimensions except batch and input_dim
      calc_dims = tuple(range(1, x.ndim - 1))
  
      self.mean = torch.mean(x, dim=calc_dims, keepdim=True).detach()
      self.stdev = torch.sqrt(
          torch.var(x, dim=calc_dims, keepdim=True, unbiased=False)
          + self.eps
      ).detach()
  
      x = x - self.mean
      x = x / self.stdev
      if self.affine:
          x = x * self.affine_weight
          x = x + self.affine_bias
  
      return x
  
file_path: darts/darts/models/components/layer_norm_variants.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the RINorm obj's underlying member method code with example usage: obj.forward(x) and returns: x