KEMBAR78
[C++ Frontend] Fix bug in torch::load and unpack torch::optim::detail namespace by goldsborough · Pull Request #15926 · pytorch/pytorch · GitHub
Skip to content

Conversation

@goldsborough
Copy link
Contributor

@goldsborough goldsborough commented Jan 10, 2019

Wasn't clearing optimizer buffers before adding new entries to it during deserialization. Successive calls to torch::load with the same optimizer would just append to the buffer container. Also moved serialize() function from torch::optim::detail into torch::optim so users can use it for custom optimizers.

Fixes #15792

@ezyang

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@goldsborough has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@soumith soumith added this to the 1.0.1 milestone Jan 15, 2019
@soumith soumith added the cherry-picked This PR was cherry-picked onto a release branch from master label Jan 18, 2019
soumith pushed a commit that referenced this pull request Jan 18, 2019
)

Summary:
Wasn't clearing optimizer buffers before adding new entries to it during deserialization. Successive calls to `torch::load` with the same optimizer would just append to the buffer container. Also moved `serialize()` function from `torch::optim::detail` into `torch::optim` so users can use it for custom optimizers.

Fixes #15792

ezyang
Pull Request resolved: #15926

Differential Revision: D13623615

Pulled By: goldsborough

fbshipit-source-id: e193091f25f56a95f2a9648af312cb7caa45f300
soumith pushed a commit that referenced this pull request Jan 29, 2019
)

Summary:
Wasn't clearing optimizer buffers before adding new entries to it during deserialization. Successive calls to `torch::load` with the same optimizer would just append to the buffer container. Also moved `serialize()` function from `torch::optim::detail` into `torch::optim` so users can use it for custom optimizers.

Fixes #15792

ezyang
Pull Request resolved: #15926

Differential Revision: D13623615

Pulled By: goldsborough

fbshipit-source-id: e193091f25f56a95f2a9648af312cb7caa45f300
@ezyang ezyang added the merged label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked This PR was cherry-picked onto a release branch from master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libtorch memory leak with torch::load optimizer

4 participants