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

Method forward

segmentation/backbones/resnet.py:69–96  ·  view source on GitHub ↗

Forward function.

(self, x)

Source from the content-addressed store, hash-verified

67 return getattr(self, self.norm2_name)
68
69 def forward(self, x):
70 """Forward function."""
71
72 def _inner_forward(x):
73 identity = x
74
75 out = self.conv1(x)
76 out = self.norm1(out)
77 out = self.relu(out)
78
79 out = self.conv2(out)
80 out = self.norm2(out)
81
82 if self.downsample is not None:
83 identity = self.downsample(x)
84
85 out += identity
86
87 return out
88
89 if self.with_cp and x.requires_grad:
90 out = cp.checkpoint(_inner_forward, x)
91 else:
92 out = _inner_forward(x)
93
94 out = self.relu(out)
95
96 return out
97
98
99class Bottleneck(BaseModule):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected