MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / UnetLayer

Class UnetLayer

open_loop_training/code/model_code/backbones/lss.py:245–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244
245class UnetLayer(nn.Module):
246 def __init__(self, in_channels, middle_channels, out_channels):
247 super(UnetLayer, self).__init__()
248 self.up = nn.ConvTranspose2d(in_channels, out_channels, kernel_size=2, stride=2)
249 self.conv_relu = nn.Sequential(
250 nn.Conv2d(middle_channels, out_channels, kernel_size=3, padding=1),
251 nn.ReLU(inplace=True),
252 )
253 self.fp16_enabled = False
254
255 @force_fp32()
256 def forward(self, x1, x2):
257 x1 = self.up(x1)
258 x1 = torch.cat((x1, x2), dim=1)
259 x1 = self.conv_relu(x1)
260 return x1
261
262class UNet(nn.Module):
263 def __init__(self, n_class, fpn_in_channels):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected