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

Method __init__

sat/sgm/modules/autoencoding/vqvae/movq_modules.py:165–173  ·  view source on GitHub ↗
(self, in_channels, zq_ch=None, add_conv=False)

Source from the content-addressed store, hash-verified

163
164class AttnBlock(nn.Module):
165 def __init__(self, in_channels, zq_ch=None, add_conv=False):
166 super().__init__()
167 self.in_channels = in_channels
168
169 self.norm = Normalize(in_channels, zq_ch, add_conv=add_conv)
170 self.q = torch.nn.Conv2d(in_channels, in_channels, kernel_size=1, stride=1, padding=0)
171 self.k = torch.nn.Conv2d(in_channels, in_channels, kernel_size=1, stride=1, padding=0)
172 self.v = torch.nn.Conv2d(in_channels, in_channels, kernel_size=1, stride=1, padding=0)
173 self.proj_out = torch.nn.Conv2d(in_channels, in_channels, kernel_size=1, stride=1, padding=0)
174
175 def forward(self, x, zq):
176 h_ = x

Callers

nothing calls this directly

Calls 2

NormalizeFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected