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

Update utils.save docs to support path-like / io.Bytes output #1553

Closed
charlesverdad opened this issue Mar 21, 2024 · 1 comment · Fixed by #1583
Closed

Update utils.save docs to support path-like / io.Bytes output #1553

charlesverdad opened this issue Mar 21, 2024 · 1 comment · Fixed by #1583
Assignees

Comments

@charlesverdad
Copy link

charlesverdad commented Mar 21, 2024

The neuralprophet.utils.save function accepts a path:str as the second argument.
This makes me believe that I can only save to a file. However upon looking at the code, it actually
just passes the path to torch.save's f parameter, which accepts io.BytesIO buffer.

Specifically, torch.save supports the type: Union[str, PathLike, BinaryIO, IO[bytes]]

This means it is already possible to use utils.save to write to memory. But the typehints and doc doesn't state that.

@SimonWittner
Copy link
Collaborator

Hi @charlesverdad,
thanks for raising this! We'll change that. If you want, you could also create a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants