Answering to my own question:
it seems the correct way to go is indeed to take the result tensor as a parameter to the CUDA extension, and not to allocate this result tensor there.
Indeed, the corresponding memory is never released if the tensor has not been created in Python