class_docstr: Channel normalization layer.
  
  This implements the channel normalization layer as described in the
  following paper:
  
  High-Fidelity Generative Image Compression
  F. Mentzer, G. Toderici, M. Tschannen, E. Agustsson
  
  Using this layer provides more stability to model outputs when there is a
  shift in image resolutions between the training set and the test set.
  
  Args:
      input_channels: Number of channels to normalize.
      epsilon: Divide-by-0 protection parameter.
      affine: Whether to include affine parameters for the noramlized output.
code: def __init__(
      self,
      input_channels: int,
      epsilon: float = 1e-3,
      affine: bool = True,
  ):
      super().__init__()
  
      if input_channels <= 1:
          raise ValueError(
              "ChannelNorm only valid for channel counts greater than 1."
          )
  
      self.epsilon = epsilon
      self.affine = affine
  
      if affine is True:
          self.gamma = nn.Parameter(torch.ones(1, input_channels, 1, 1))
          self.beta = nn.Parameter(torch.zeros(1, input_channels, 1, 1))
  
imports: import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 1 to create a new ChannelNorm2D object from inherited base classes: nn with example: obj = ChannelNorm2D(input_channels, epsilon, affine)