MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _inner_forward

Method _inner_forward

detrsmpl/models/backbones/resnet.py:260–287  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

258 def forward(self, x):
259 """Forward function."""
260 def _inner_forward(x):
261 identity = x
262 out = self.conv1(x)
263 out = self.norm1(out)
264 out = self.relu(out)
265
266 if self.with_plugins:
267 out = self.forward_plugin(out, self.after_conv1_plugin_names)
268
269 out = self.conv2(out)
270 out = self.norm2(out)
271 out = self.relu(out)
272
273 if self.with_plugins:
274 out = self.forward_plugin(out, self.after_conv2_plugin_names)
275
276 out = self.conv3(out)
277 out = self.norm3(out)
278
279 if self.with_plugins:
280 out = self.forward_plugin(out, self.after_conv3_plugin_names)
281
282 if self.downsample is not None:
283 identity = self.downsample(x)
284
285 out += identity
286
287 return out
288
289 if self.with_cp and x.requires_grad:
290 out = cp.checkpoint(_inner_forward, x)

Callers

nothing calls this directly

Calls 4

norm1Method · 0.95
forward_pluginMethod · 0.95
norm2Method · 0.95
norm3Method · 0.95

Tested by

no test coverage detected