getkeops / keops

KErnel OPerationS, on CPUs and GPUs, with autodiff and without memory overflows
https://www.kernel-operations.io
MIT License
1.03k stars 65 forks source link

Fix a memory leak when using range with no batch #314

Closed NightWinkle closed 1 year ago

NightWinkle commented 1 year ago

A fix for the memory leak I describe in issue 284. Specifically, when using KeOps with ranges but no batch dimension, slices_x_d and ranges_y_d are not freed.

NightWinkle commented 1 year ago

After checking, the error was caused by the fact that my tensor were on CPU, but this is still a weird behavior to have a memory leak on GPU when the computations should be on CPU.