MCPcopy Create free account
hub / github.com/KimMeen/Time-LLM / forward

Method forward

layers/Transformer_EncDec.py:98–116  ·  view source on GitHub ↗
(self, x, cross, x_mask=None, cross_mask=None, tau=None, delta=None)

Source from the content-addressed store, hash-verified

96 self.activation = F.relu if activation == "relu" else F.gelu
97
98 def forward(self, x, cross, x_mask=None, cross_mask=None, tau=None, delta=None):
99 x = x + self.dropout(self.self_attention(
100 x, x, x,
101 attn_mask=x_mask,
102 tau=tau, delta=None
103 )[0])
104 x = self.norm1(x)
105
106 x = x + self.dropout(self.cross_attention(
107 x, cross, cross,
108 attn_mask=cross_mask,
109 tau=tau, delta=delta
110 )[0])
111
112 y = x = self.norm2(x)
113 y = self.dropout(self.activation(self.conv1(y.transpose(-1, 1))))
114 y = self.dropout(self.conv2(y).transpose(-1, 1))
115
116 return self.norm3(x + y)
117
118
119class Decoder(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected