Skip to content
Merged
Changes from 1 commit
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
14 changes: 9 additions & 5 deletions pytorch_forecasting/models/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ def forward(self, x: dict[str, torch.Tensor]) -> dict[str, torch.Tensor]:
"""
Network forward pass.

Args:
x (Dict[str, torch.Tensor]): network input

Returns:
Dict[str, torch.Tensor]: network outputs
Parameters
----------
x : dict of {str : torch.Tensor}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be Dict[str, torch.Tensor]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the numpydocstyle standard for dictionaries is technically dict of {key_type: value_type}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if we need to change it to square bracket i will do it, should i?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean its a common convention we've been following since the start, that's why I suggested it. I understand what you mean, but I would prefer following already set convention in docs to prevent any misunderstandings :)

network input

Returns
-------
dict of {str : torch.Tensor}
network outputs
"""
if isinstance(x["encoder_target"], tuple | list): # multiple targets
prediction = [
Expand Down
Loading