(self, x)
| 27 | self.groups = groups |
| 28 | |
| 29 | def forward(self, x): |
| 30 | batch = x.size(0) |
| 31 | if self.radix > 1: |
| 32 | x = x.view(batch, self.groups, self.radix, -1).transpose(1, 2) |
| 33 | x = F.softmax(x, dim=1) |
| 34 | x = x.reshape(batch, -1) |
| 35 | else: |
| 36 | x = torch.sigmoid(x) |
| 37 | return x |
| 38 | |
| 39 | |
| 40 | class SplitAttentionConv2d(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected