class_docstr: Spatial CGNL block with dot production kernel for image classfication.
      
class_docstr_tok: ["Spatial","CGNL","block","with","dot","production","kernel","for","image","classfication","."]
code: def __init__(self, inplanes, planes, use_scale=False, groups=8):
      self.use_scale = use_scale
      self.groups = groups
  
      super(SpatialCGNL, self).__init__()
      # conv theta
      self.t = nn.Conv2d(
          inplanes, planes, kernel_size=1, stride=1, bias=False
      )
      # conv phi
      self.p = nn.Conv2d(
          inplanes, planes, kernel_size=1, stride=1, bias=False
      )
      # conv g
      self.g = nn.Conv2d(
          inplanes, planes, kernel_size=1, stride=1, bias=False
      )
      # conv z
      self.z = nn.Conv2d(
          planes,
          inplanes,
          kernel_size=1,
          stride=1,
          groups=self.groups,
          bias=False,
      )
      self.gn = nn.GroupNorm(
          num_groups=self.groups, num_channels=inplanes
      )
  
      if self.use_scale:
          print("=> WARN: SpatialCGNL block uses 'SCALE'", "yellow")
      if self.groups:
          print(
              "=> WARN: SpatialCGNL block uses '{}' groups".format(
                  self.groups
              ),
              "yellow",
          )
  
imports: import torch.nn
  import torch
  import torch.nn.functional
  from torch.nn import BatchNorm2d
label_desc: Use image node_id 1 to create a new SpatialCGNL object from inherited base classes: nn with example: obj = SpatialCGNL(inplanes, planes, use_scale, groups)