MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / forward

Method forward

segmentation/backbones/cgnet.py:38–51  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

36 nn.Linear(channel // reduction, channel), nn.Sigmoid())
37
38 def forward(self, x):
39
40 def _inner_forward(x):
41 num_batch, num_channel = x.size()[:2]
42 y = self.avg_pool(x).view(num_batch, num_channel)
43 y = self.fc(y).view(num_batch, num_channel, 1, 1)
44 return x * y
45
46 if self.with_cp and x.requires_grad:
47 out = cp.checkpoint(_inner_forward, x)
48 else:
49 out = _inner_forward(x)
50
51 return out
52
53
54class ContextGuidedBlock(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected