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

Before Change


    lenpath = os.path.join(lazypath, data_type+".len.pkl")
    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:

After Change


        with open(datapath, "wb") as f:
            str_ends = []
            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):
            time.sleep(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: yangyanli/PointCNN
Commit Name: 632ffd19e4edb2077b2c27a50f1654b7453797e6
Time: 2019-03-28
Author: burui11087@gmail.com
File Name: data_conversions/prepare_semantic3d_filelists.py
Class Name:
Method Name: main


Project Name: hunkim/PyTorchZeroToAll
Commit Name: 55b880469ced115de9949d5d25ff835dabbb2caa
Time: 2017-11-08
Author: hunkim@gmail.com
File Name: 12_2_hello_rnn.py
Class Name:
Method Name: