mirror of
https://github.com/wassname/pytorch-transformer-ts.git
synced 2026-07-21 12:50:20 +08:00
expand static feat
This commit is contained in:
+3
-2
@@ -225,10 +225,11 @@ class TemporalFusionDecoder(nn.Module):
|
||||
def forward(
|
||||
self, x: torch.Tensor, static: torch.Tensor, mask: Optional[torch.Tensor] = None
|
||||
) -> torch.Tensor:
|
||||
static = static.repeat((1, self.context_length + self.prediction_length, 1))
|
||||
expanded_static = static.expand_as(x)
|
||||
# static.repeat((1, self.context_length + self.prediction_length, 1))
|
||||
|
||||
skip = x[:, self.context_length :, ...]
|
||||
x = self.enrich(x, static)
|
||||
x = self.enrich(x, expanded_static)
|
||||
|
||||
# does not work on GPU :-(
|
||||
# mask_pad = torch.ones_like(mask)[:, 0:1, ...]
|
||||
|
||||
Reference in New Issue
Block a user