MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

layers/Embed.py:56–63  ·  view source on GitHub ↗
(self, c_in, d_model)

Source from the content-addressed store, hash-verified

54
55class TokenEmbedding(nn.Module):
56 def __init__(self, c_in, d_model):
57 super(TokenEmbedding, self).__init__()
58 padding = 1 if torch.__version__ >= '1.5.0' else 2
59 self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model,
60 kernel_size=3, padding=padding, padding_mode='circular', bias=False)
61 for m in self.modules():
62 if isinstance(m, nn.Conv1d):
63 nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='leaky_relu')
64
65 def forward(self, x):
66 x = self.tokenConv(x.permute(0, 2, 1)).transpose(1, 2)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected