MCPcopy Create free account
hub / github.com/SooLab/CGFormer / __init__

Method __init__

model/layers.py:214–227  ·  view source on GitHub ↗
(self, token_dim, bias, drop)

Source from the content-addressed store, hash-verified

212# updated version
213class LoadToken(nn.Module):
214 def __init__(self, token_dim, bias, drop) -> None:
215 super().__init__()
216 self.cross_attn = CrossAttn(
217 q_dim=token_dim,
218 kv_dim=768,
219 hidden_dim=token_dim,
220 num_heads=1,
221 out_dim=token_dim,
222 qkv_bias=bias,
223 attn_drop=drop,
224 proj_drop=drop,
225 )
226 self.normq = nn.LayerNorm(token_dim)
227 self.normk = nn.LayerNorm(768)
228
229 def forward(self, tokens, text, pad_mask):
230 ltoken, ttoken = torch.split(tokens, [tokens.shape[1]-1,1], dim=1)

Callers

nothing calls this directly

Calls 2

CrossAttnClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected