MCPcopy Create free account
hub / github.com/OpenDriveLab/TCP / __init__

Method __init__

roach/models/torch_util.py:45–54  ·  view source on GitHub ↗
(self, inchan, scale=1, batch_norm=False)

Source from the content-addressed store, hash-verified

43 """
44
45 def __init__(self, inchan, scale=1, batch_norm=False):
46 super().__init__()
47 self.inchan = inchan
48 self.batch_norm = batch_norm
49 s = math.sqrt(scale)
50 self.conv0 = NormedConv2d(self.inchan, self.inchan, 3, padding=1, scale=s)
51 self.conv1 = NormedConv2d(self.inchan, self.inchan, 3, padding=1, scale=s)
52 if self.batch_norm:
53 self.bn0 = nn.BatchNorm2d(self.inchan)
54 self.bn1 = nn.BatchNorm2d(self.inchan)
55
56 def residual(self, x):
57 # inplace should be False for the first relu, so that it does not change the input,

Callers

nothing calls this directly

Calls 2

NormedConv2dFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected