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

Method forward

detrsmpl/models/backbones/resnet.py:602–617  ·  view source on GitHub ↗

Forward function.

(self, x)

Source from the content-addressed store, hash-verified

600 param.requires_grad = False
601
602 def forward(self, x):
603 """Forward function."""
604 if self.deep_stem:
605 x = self.stem(x)
606 else:
607 x = self.conv1(x)
608 x = self.norm1(x)
609 x = self.relu(x)
610 x = self.maxpool(x)
611 outs = []
612 for i, layer_name in enumerate(self.res_layers):
613 res_layer = getattr(self, layer_name)
614 x = res_layer(x)
615 if i in self.out_indices:
616 outs.append(x)
617 return tuple(outs)
618
619 def train(self, mode=True):
620 """Convert the model into training mode while keep normalization layer

Callers

nothing calls this directly

Calls 1

norm1Method · 0.95

Tested by

no test coverage detected