A “memory leak” is often caused by storing tensors, which are still attached to the computation graph, in e.g. a list, which would then also store the entire computation graph. While this is not a memory leak and expected behavior, users often call it a leak.
Check if this could also be the case in your script and if so, make sure to detach() tensors which should not store the entire graph with them.