The memory doesn’t seem to grow in each iteration or am I missing something?
Depending on the size of your input the current iteration might need more memory than the previous one, but the memory footprint seems to go down as expected after deleting the tensors.