Hi,ptrblck, I solved this problem.
look into this code, and it is a function of a sampler of Dataloader. def iter(self) returns iter(torch.IntTensor(np_idx)), if I change this to iter(numpy(list)), it’s correct. old version shows returning iter(torch.tensor) is correct, but version 0.4.1shows segment fault when the size is huge.
class randomSubsetSampler(sampler.Sampler):

    def __init__(self, data_source):
        self.word_len_list = data_source.word_len_list
        self.num_samples = len(data_source)

    def __iter__(self):
        np_idx = []
        prev_count = 0
        for word_len in self.word_len_list:
            subidx = list(range(word_len))
            random.shuffle(subidx)
            np_idx += [i + prev_count for i in subidx]
            prev_count += word_len
        index = torch.IntTensor(np_idx)

        return iter(index)

    def __len__(self):
        return self.num_samples