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

Method forward

segmentation/backbones/resnest.py:227–267  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

225 self.add_module(self.norm3_name, norm3)
226
227 def forward(self, x):
228
229 def _inner_forward(x):
230 identity = x
231
232 out = self.conv1(x)
233 out = self.norm1(out)
234 out = self.relu(out)
235
236 if self.with_plugins:
237 out = self.forward_plugin(out, self.after_conv1_plugin_names)
238
239 out = self.conv2(out)
240
241 if self.avg_down_stride:
242 out = self.avd_layer(out)
243
244 if self.with_plugins:
245 out = self.forward_plugin(out, self.after_conv2_plugin_names)
246
247 out = self.conv3(out)
248 out = self.norm3(out)
249
250 if self.with_plugins:
251 out = self.forward_plugin(out, self.after_conv3_plugin_names)
252
253 if self.downsample is not None:
254 identity = self.downsample(x)
255
256 out += identity
257
258 return out
259
260 if self.with_cp and x.requires_grad:
261 out = cp.checkpoint(_inner_forward, x)
262 else:
263 out = _inner_forward(x)
264
265 out = self.relu(out)
266
267 return out
268
269
270@BACKBONES.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected