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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve save() method in torch.jit.ScriptModule #17688

Open
laughmetal opened this issue Mar 5, 2019 · 5 comments
Open

Improve save() method in torch.jit.ScriptModule #17688

laughmetal opened this issue Mar 5, 2019 · 5 comments
Labels
jit-backlog low priority We're unlikely to get around to doing this in the near future oncall: jit Add this issue/PR to JIT oncall triage queue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@laughmetal
Copy link

laughmetal commented Mar 5, 2019

馃殌 Feature

save() method in torch.jit.ScriptModule should support save_to_buffer as well.

Motivation

Right now, to save a torch.jit.ScriptModule to buffer, I have to call function torch.jit.save().
It would be more convenient and consistent if torch.jit.ScriptModule.save() can perform the same job.

Pitch

I can work on this feature.

cc @suo

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 5, 2019
@eellison
Copy link
Contributor

eellison commented Mar 6, 2019

Thanks for the feature request! We will discuss this and get back to you

@suo
Copy link
Member

suo commented Mar 8, 2019

This would be decently easy, since it's already in the c++ module type. @laughmetal if you'd like to work on it, we would be happy to review a PR! 馃槃

@suo suo added the low priority We're unlikely to get around to doing this in the near future label Mar 8, 2019
@laughmetal
Copy link
Author

laughmetal commented Mar 9, 2019

You are right. It's probably just a binding decision. Should we change the binding, or should we add a new session to the doc after this?

@suo
Copy link
Member

suo commented Mar 11, 2019

I think it would be reasonable to make ScriptModule.save() and torch.jit.save() consistent. So ScriptModule.save() would either save to a buffer or a file depending on the passed argument.

@suo suo removed the jit-triaged label Mar 11, 2019
@suo suo added the jit-backlog label Oct 3, 2019
@wanchaol wanchaol added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Dec 2, 2019
@WilliamTambellini
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jit-backlog low priority We're unlikely to get around to doing this in the near future oncall: jit Add this issue/PR to JIT oncall triage queue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

6 participants