MCPcopy Create free account
hub / github.com/Yasoz/DiffTraj / __init__

Method __init__

utils/module.py:40–64  ·  view source on GitHub ↗
(self, in_channels)

Source from the content-addressed store, hash-verified

38
39class AttnBlock(nn.Module):
40 def __init__(self, in_channels):
41 super().__init__()
42 self.in_channels = in_channels
43
44 self.norm = Normalize(in_channels)
45 self.q = torch.nn.Conv2d(in_channels,
46 in_channels,
47 kernel_size=1,
48 stride=1,
49 padding=0)
50 self.k = torch.nn.Conv2d(in_channels,
51 in_channels,
52 kernel_size=1,
53 stride=1,
54 padding=0)
55 self.v = torch.nn.Conv2d(in_channels,
56 in_channels,
57 kernel_size=1,
58 stride=1,
59 padding=0)
60 self.proj_out = torch.nn.Conv2d(in_channels,
61 in_channels,
62 kernel_size=1,
63 stride=1,
64 padding=0)
65
66 def forward(self, x):
67 h_ = x

Callers

nothing calls this directly

Calls 1

NormalizeFunction · 0.70

Tested by

no test coverage detected