class_docstr: Spatial squeeze module
docstr: Instantiate module
  
  :param channels: Number of input channels
  :param reduction: Reduction factor
  :param squeeze_channels: Number of channels in squeeze block.
docstr_tok: ["Instantiate","module",":","param","channels",":","Number","of","input","channels",":","param","reduction",":","Reduction","factor",":","param","squeeze_channels",":","Number","of","channels","in","squeeze","block","."]
code: def __init__(self, channels, reduction=None, squeeze_channels=None):
      """
      Instantiate module
  
      :param channels: Number of input channels
      :param reduction: Reduction factor
      :param squeeze_channels: Number of channels in squeeze block.
      """
      super().__init__()
      assert (
          reduction or squeeze_channels
      ), "One of 'reduction' and 'squeeze_channels' must be set"
      assert not (
          reduction and squeeze_channels
      ), "'reduction' and 'squeeze_channels' are mutually exclusive"
  
      if squeeze_channels is None:
          squeeze_channels = max(1, channels // reduction)
      self.avg_pool = nn.AdaptiveAvgPool2d(1)
      self.squeeze = nn.Conv2d(
          channels, squeeze_channels, kernel_size=1
      )
      self.expand = nn.Conv2d(squeeze_channels, channels, kernel_size=1)
  
imports: from torch import nn, Tensor
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new SpatialGate2d object from inherited base classes: nn with example: obj = SpatialGate2d(channels, reduction, squeeze_channels)