Autoformer encoder
| 180 | |
| 181 | |
| 182 | class Decoder(nn.Module): |
| 183 | """ |
| 184 | Autoformer encoder |
| 185 | """ |
| 186 | |
| 187 | def __init__(self, layers, norm_layer=None, projection=None): |
| 188 | super(Decoder, self).__init__() |
| 189 | self.layers = nn.ModuleList(layers) |
| 190 | self.norm = norm_layer |
| 191 | self.projection = projection |
| 192 | |
| 193 | def forward(self, x, cross, x_mask=None, cross_mask=None, trend=None): |
| 194 | for layer in self.layers: |
| 195 | x, residual_trend = layer(x, cross, x_mask=x_mask, cross_mask=cross_mask) |
| 196 | trend = trend + residual_trend |
| 197 | |
| 198 | if self.norm is not None: |
| 199 | x = self.norm(x) |
| 200 | |
| 201 | if self.projection is not None: |
| 202 | x = self.projection(x) |
| 203 | return x, trend |
nothing calls this directly
no outgoing calls
no test coverage detected