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

Method forward

layers/Autoformer_EncDec.py:120–137  ·  view source on GitHub ↗
(self, x, attn_mask=None)

Source from the content-addressed store, hash-verified

118 self.norm = norm_layer
119
120 def forward(self, x, attn_mask=None):
121 attns = []
122 if self.conv_layers is not None:
123 for attn_layer, conv_layer in zip(self.attn_layers, self.conv_layers):
124 x, attn = attn_layer(x, attn_mask=attn_mask)
125 x = conv_layer(x)
126 attns.append(attn)
127 x, attn = self.attn_layers[-1](x)
128 attns.append(attn)
129 else:
130 for attn_layer in self.attn_layers:
131 x, attn = attn_layer(x, attn_mask=attn_mask)
132 attns.append(attn)
133
134 if self.norm is not None:
135 x = self.norm(x)
136
137 return x, attns
138
139
140class DecoderLayer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected