(self, feature)
| 17 | ) |
| 18 | |
| 19 | def forward(self, feature): |
| 20 | n,c,h,w = feature.shape |
| 21 | if (h != self.spatial_dim): |
| 22 | x = F.interpolate(feature,size=(self.spatial_dim,self.spatial_dim),mode= "bilinear", align_corners=True) |
| 23 | else: |
| 24 | x = feature |
| 25 | |
| 26 | |
| 27 | x = x.view(n,c,-1) |
| 28 | x = self.linear(x) |
| 29 | x = x.unsqueeze(dim =3) |
| 30 | out = x.expand_as(feature)*feature |
| 31 | |
| 32 | return out |
| 33 | |
| 34 | |
| 35 | class to_map(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected