I am measuring the GPU memory consumption. I am using the command nvidia-smi to check how much memory is allocated for the particular PID. Whenever I execute the code attached above, 11Gb is added to the memory allocated for the process (literally every time I do inference). That memory does not get unallocated until I restart the kernel.