Would you try to create the tensor via torch.from_numpy(dt[0:700000])? Your code would most likely copy the data currently, which seems to cause this error. How much RAM does your machine have and how big is the data, i.e. how many features for each sample in which format?