Skip to content

Fix memory leak in handle_circular_pad#17

Open
jvwilliams23 wants to merge 1 commit intoLBANN:mainfrom
jvwilliams23:fix-circular-memleak
Open

Fix memory leak in handle_circular_pad#17
jvwilliams23 wants to merge 1 commit intoLBANN:mainfrom
jvwilliams23:fix-circular-memleak

Conversation

@jvwilliams23
Copy link
Contributor

Closes #16.

Avoid calling _ToTensor and _FromTensor in the function, as this was creating un-freed (if that's a word?) references to the tensors.

To get around this, we recursively call _handle_circular_pad.
The first time will assign the relevant DCTensor attributes and modify the input padding. The second will apply the torch padding fn via super().__torch_function__(...)

Avoid calling _ToTensor and _FromTensor in the function, as this was creating unfreed references.
Instead, recursively call _handle_circular_pad.
The first time will assign the relevant DCTensor attributes and modify the input padding.
The second will apply the torch padding fn via super().__torch_function__(...)
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 this pull request may close these issues.

Periodic padding memory leak

1 participant