83d80c5a19326a516b4ab54339c27f8cac349693,data_utils/lazy_loader.py,,make_lazy,#,24

Before Change


    if not torch.distributed._initialized or torch.distributed.get_rank() == 0:
        with open(datapath, "w") as f:
            f.write("".join(strs))
        str_ends = list(accumulate(map(len, strs)))
        pkl.dump(str_ends, open(lenpath, "wb"))
    else:
        while not os.path.exists(lenpath):
            time.sleep(1)

After Change


            str_cnt = 0
            for s in strs:
                f.write(s.encode("utf-8"))
                str_cnt += len(s)
                str_ends.append(str_cnt)
        pkl.dump(str_ends, open(lenpath, "wb"))
    else:
        while not os.path.exists(lenpath):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: NVIDIA/sentiment-discovery
Commit Name: 83d80c5a19326a516b4ab54339c27f8cac349693
Time: 2018-06-14
Author: raulpuric@berkeley.edu
File Name: data_utils/lazy_loader.py
Class Name:
Method Name: make_lazy


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: 4888cb7a5299f7eed9214ddc70871dc05ea0f4d2
Time: 2019-03-20
Author: zdzheng12@gmail.com
File Name: model/ft_ResNet50/train.py
Class Name:
Method Name:


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: 4888cb7a5299f7eed9214ddc70871dc05ea0f4d2
Time: 2019-03-20
Author: zdzheng12@gmail.com
File Name: train.py
Class Name:
Method Name: