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

Suspicious memory explosions - Add __del__ method to differentiable #16

Open
JasperSnoek opened this issue Nov 22, 2014 · 1 comment
Open

Comments

@JasperSnoek
Copy link
Contributor

Something strange is happening when the graph is dynamically altered that seems to prevent nodes (or graphs) from being garbage collected.

Adding a del method to differentiable that removes links to a node from its parents might help solve this.

@kswersky
Copy link

This can be done using Python's weakref module. Essentially, you can modify it so that forward links from the parent to its children are weak references that get destroyed when the children have no more strong references to them. You have to be a bit careful to make sure that you don't wrap a weakref in an object like a list that acts as a strong reference, but it should be very possible to solve this problem. I will submit a pull request soon with a fix.

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

No branches or pull requests

2 participants