i am getting the same error when trying to load a simple torch tensor (.pt) it didn’t happen in the past and only started happening after i did some preprocessing protocol on all the tensors in my in-disk dataset.
my code is simple and goes like this:
mask = np.load(path_to_mask) #the preprocess is actually a simple mask application
for path in os.listdir(path_to_all_pt_files):
    scan = torch.load(path)
    scan = preprocess(scan,mask)
    torch.save(scan,path)

def preprocess(scan,mask):
     masked = scan * torch.from_numpy(mask)
     masked = masked.to(dtype=scan.dtype)
     return masked

what could be the cause?