2c170a8c17a1e887af36af0e53c332be47893b21,tests/mxnet/test_sampler.py,,test_1neighbor_sampler_all,#,13

Before Change


        assert len(seed_ids) == 1
        src, dst, eid = g._graph.in_edges(utils.toindex(seed_ids))
        // Test if there is a self loop
        self_loop = mx.nd.sum(src.tousertensor() == dst.tousertensor()).asnumpy() == 1
        if self_loop:
            assert subg.number_of_nodes() == len(src)
        else:

After Change


    for subg, seed_ids in dgl.contrib.sampling.NeighborSampler(g, 1, 100, neighbor_type="in",
                                                               num_workers=4):
        assert len(seed_ids) == 1
        src, dst, eid = g.in_edges(seed_ids, form="all")
        // Test if there is a self loop
        self_loop = mx.nd.sum(src == dst).asnumpy() == 1
        if self_loop:
            assert subg.number_of_nodes() == len(src)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: dmlc/dgl
Commit Name: 2c170a8c17a1e887af36af0e53c332be47893b21
Time: 2018-12-03
Author: zhengda1936@gmail.com
File Name: tests/mxnet/test_sampler.py
Class Name:
Method Name: test_1neighbor_sampler_all


Project Name: dmlc/dgl
Commit Name: fc7775a20f8c4b9f58ee9cbf76516b2b7e823b67
Time: 2019-06-09
Author: zhengda1936@gmail.com
File Name: tests/compute/test_nodeflow.py
Class Name:
Method Name: test_block_edges


Project Name: dmlc/dgl
Commit Name: 2c170a8c17a1e887af36af0e53c332be47893b21
Time: 2018-12-03
Author: zhengda1936@gmail.com
File Name: tests/mxnet/test_sampler.py
Class Name:
Method Name: verify_subgraph