As long as you don’t hold a reference to the Variable, PyTorch will take care of freeing the memory for your.
Note that nvidia-smi does not necessarily give the correct amount of used memory, since PyTorch uses a caching memory allocator 6.