MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / __init__

Method __init__

usr/diff/diffusion.py:135–140  ·  view source on GitHub ↗
(self, dim, heads=4, dim_head=32)

Source from the content-addressed store, hash-verified

133
134class LinearAttention(nn.Module):
135 def __init__(self, dim, heads=4, dim_head=32):
136 super().__init__()
137 self.heads = heads
138 hidden_dim = dim_head * heads
139 self.to_qkv = nn.Conv2d(dim, hidden_dim * 3, 1, bias=False)
140 self.to_out = nn.Conv2d(hidden_dim, dim, 1)
141
142 def forward(self, x):
143 b, c, h, w = x.shape

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected