Thank you!! I try it and it can actually works. But this approach will copy the data every iteration which will slow down the process. I agree the problem exists because I reuse the same input in every iteration. I wonder is there any in-place method instead of copy the data to a new memory?