Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/TFTModel_flask #745

Merged
merged 3 commits into from
Jan 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions darts/models/forecasting/tft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def forward(self, x) -> Dict[str, torch.Tensor]:
input dimensions: (n_samples, n_time_steps, n_variables)
"""

dim_samples, dim_time, dim_variable, dim_loss = 0, 1, 2, 3
dim_samples, dim_time, dim_variable = 0, 1, 2
past_target, past_covariates, historic_future_covariates, future_covariates = x

batch_size = past_target.shape[dim_samples]
Expand Down Expand Up @@ -450,12 +450,13 @@ def forward(self, x) -> Dict[str, torch.Tensor]:
device=past_target.device,
)

# this is only to interpret the output
static_covariate_var = torch.zeros(
(past_target.shape[0], 0),
dtype=past_target.dtype,
device=past_target.device,
)
# # TODO: implement below when static covariates are supported
# # this is only to interpret the output
# static_covariate_var = torch.zeros(
# (past_target.shape[0], 0),
# dtype=past_target.dtype,
# device=past_target.device,
# )

if future_covariates is None and static_covariates is None:
raise NotImplementedError("make zero tensor if future covariates is None")
Expand Down