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

Method forward

segmentation/backbones/resnet.py:659–674  ·  view source on GitHub ↗

Forward function.

(self, x)

Source from the content-addressed store, hash-verified

657 param.requires_grad = False
658
659 def forward(self, x):
660 """Forward function."""
661 if self.deep_stem:
662 x = self.stem(x)
663 else:
664 x = self.conv1(x)
665 x = self.norm1(x)
666 x = self.relu(x)
667 x = self.maxpool(x)
668 outs = []
669 for i, layer_name in enumerate(self.res_layers):
670 res_layer = getattr(self, layer_name)
671 x = res_layer(x)
672 if i in self.out_indices:
673 outs.append(x)
674 return tuple(outs)
675
676 def train(self, mode=True):
677 """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