"src/array/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "50f1f4ae780677374db79af5b91a6b043bbebf54"
Unverified Commit 97c3f870 authored by Andrei Ivanov's avatar Andrei Ivanov Committed by GitHub
Browse files

Improving sampling tests. (#6167)


Co-authored-by: default avatarHongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
parent f586c415
import unittest import unittest
from collections import defaultdict import warnings
import backend as F import backend as F
...@@ -1774,6 +1774,7 @@ def test_sample_neighbors_exclude_edges_homoG(dtype, fused): ...@@ -1774,6 +1774,7 @@ def test_sample_neighbors_exclude_edges_homoG(dtype, fused):
@pytest.mark.parametrize("dtype", ["int32", "int64"]) @pytest.mark.parametrize("dtype", ["int32", "int64"])
def test_global_uniform_negative_sampling(dtype): def test_global_uniform_negative_sampling(dtype):
warnings.simplefilter("ignore", np.ComplexWarning)
g = dgl.graph(([], []), num_nodes=1000).to(F.ctx()) g = dgl.graph(([], []), num_nodes=1000).to(F.ctx())
src, dst = dgl.sampling.global_uniform_negative_sampling( src, dst = dgl.sampling.global_uniform_negative_sampling(
g, 2000, False, True g, 2000, False, True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment