9488bace208911b1bc1efb17774d8000fed1acac,examples/pytorch/ogb/deepwalk/load_dataset.py,,,#,12

Before Change


            if weighted:
                f.write(str(g.edges()[0][i].item()) + " "\
                    +str(g.edges()[1][i].item()) + " "\
                    +str(g.edata["edge_weight"][i].item()) + "\n")
            else:
                f.write(str(g.edges()[0][i].item()) + " "\
                    +str(g.edges()[1][i].item()) + " "\

After Change


        weight = list(g.edata["edge_weight"])

    print("writing...")
    start_time = time.time()
    with open(name + "-net.txt", "w") as f:
        for i in range(edge_num):
            if weighted:
                f.write(str(src[i].item()) + " "\
                    +str(tgt[i].item()) + " "\
                    +str(weight[i].item()) + "\n")
            else:
                f.write(str(src[i].item()) + " "\
                    +str(tgt[i].item()) + " "\
                    +"1\n")
    print("writing used time: %d s" % int(time.time() - start_time))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: dmlc/dgl
Commit Name: 9488bace208911b1bc1efb17774d8000fed1acac
Time: 2020-09-14
Author: taxuexh@sjtu.edu.cn
File Name: examples/pytorch/ogb/deepwalk/load_dataset.py
Class Name:
Method Name:


Project Name: dmlc/dgl
Commit Name: 9488bace208911b1bc1efb17774d8000fed1acac
Time: 2020-09-14
Author: taxuexh@sjtu.edu.cn
File Name: examples/pytorch/ogb/deepwalk/load_dataset.py
Class Name:
Method Name:


Project Name: scikit-image/scikit-image
Commit Name: 7d949ddda1c424773171a1db21f68eb8e6bb17cd
Time: 2018-05-07
Author: juan.n@unimelb.edu.au
File Name: doc/examples/xx_applications/plot_haar_extraction_selection_classification.py
Class Name:
Method Name:


Project Name: tensorlayer/tensorlayer
Commit Name: 8b68349d43621619fe799ab4afc21da7f1fb2515
Time: 2019-06-10
Author: 34995488+Tokarev-TT-33@users.noreply.github.com
File Name: examples/reinforcement_learning/tutorial_PPO.py
Class Name:
Method Name: