MCPcopy Index your code
hub / github.com/OpenDriveLab/TCP / _forward_impl

Method _forward_impl

TCP/resnet.py:230–246  ·  view source on GitHub ↗
(self, x: Tensor)

Source from the content-addressed store, hash-verified

228 return nn.Sequential(*layers)
229
230 def _forward_impl(self, x: Tensor) -> Tensor:
231 # See note [TorchScript super()]
232 x = self.conv1(x)
233 x = self.bn1(x)
234 x = self.relu(x)
235 x = self.maxpool(x)
236
237 x = self.layer1(x)
238 x = self.layer2(x)
239 x = self.layer3(x)
240 x_layer4 = self.layer4(x)
241
242 x = self.avgpool(x_layer4)
243 x = torch.flatten(x, 1)
244 x = self.fc(x)
245
246 return x, x_layer4
247
248 def forward(self, x: Tensor) -> Tensor:
249 return self._forward_impl(x)

Callers 1

forwardMethod · 0.95

Calls 1

flattenMethod · 0.80

Tested by

no test coverage detected