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

Method __init__

roach/models/torch_util.py:79–88  ·  view source on GitHub ↗
(self, inchan, nblock, outchan, scale=1, pool=True, **kwargs)

Source from the content-addressed store, hash-verified

77 """
78
79 def __init__(self, inchan, nblock, outchan, scale=1, pool=True, **kwargs):
80 super().__init__()
81 self.inchan = inchan
82 self.outchan = outchan
83 self.pool = pool
84 self.firstconv = NormedConv2d(inchan, outchan, 3, padding=1)
85 s = scale / math.sqrt(nblock)
86 self.blocks = nn.ModuleList(
87 [CnnBasicBlock(outchan, scale=s, **kwargs) for _ in range(nblock)]
88 )
89
90 def forward(self, x):
91 x = self.firstconv(x)

Callers 1

__init__Method · 0.45

Calls 2

NormedConv2dFunction · 0.85
CnnBasicBlockClass · 0.85

Tested by

no test coverage detected