(self)
| 221 | |
| 222 | class SpatialAttentionModule(nn.Module): |
| 223 | def __init__(self): |
| 224 | super(SpatialAttentionModule, self).__init__() |
| 225 | self.conv2d = nn.Conv2d(in_channels=2, out_channels=1, kernel_size=7, stride=1, padding=3) |
| 226 | self.sigmoid = nn.Sigmoid() |
| 227 | |
| 228 | def forward(self, x): |
| 229 | avgout = torch.mean(x, dim=1, keepdim=True) |