class_docstr: Channel-wise self-attention block. Modified from DDPM.
class_docstr_tok: ["Channel-wise","self-attention","block",".","Modified","from","DDPM","."]
code: def __init__(self, channels, skip_rescale=False, init_scale=0.0):
      super().__init__()
      self.GroupNorm_0 = nn.GroupNorm(
          num_groups=min(channels // 4, 32),
          num_channels=channels,
          eps=1e-6,
      )
      self.NIN_0 = NIN(channels, channels)
      self.NIN_1 = NIN(channels, channels)
      self.NIN_2 = NIN(channels, channels)
      self.NIN_3 = NIN(channels, channels, init_scale=init_scale)
      self.skip_rescale = skip_rescale
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from espnet2.enh.layers.ncsnpp_utils import layers, up_or_down_sampling
label_desc: Use image node_id 1 to create a new AttnBlockpp object from inherited base classes: nn with example: obj = AttnBlockpp(channels, skip_rescale, init_scale)