I have a huge data, lets say a large cache of vae encoded stuff, I want to access the values I need, but after that I do not need to keep them in my cpu memory, how do I do that?
load is simple:
data = torch.load(r"huge_vae_dict.ckpt",weights_only=1,mmap=1)
but once I accessed all the value, the whole dict ends up in my ram
with torch.no_grad():
for k in tqdm(data):
v = data[k]+1
I wish we can access the data but not end with with them all in the memory.