Unverified Commit 74c9d27d authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Auto-format tests. (#5313)



* [Misc] Auto-format tests.

* more

---------
Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
parent 86193c26
This diff is collapsed.
import backend as F
from test_utils import parametrize_idtype
import dgl
from test_utils import parametrize_idtype
@parametrize_idtype
......
import unittest
import backend as F
from test_utils import parametrize_idtype
from dgl.distributed import graph_partition_book as gpb
from dgl.partition import NDArrayPartition
from test_utils import parametrize_idtype
@unittest.skipIf(
......@@ -13,13 +13,13 @@ from dgl.partition import NDArrayPartition
)
@parametrize_idtype
def test_get_node_partition_from_book(idtype):
node_map = {'_N': F.tensor([[0, 3], [4, 5], [6, 10]], dtype=idtype)}
edge_map = {('_N', '_E', '_N'): F.tensor([[0, 9], [10, 15], [16, 25]], dtype=idtype)}
node_map = {"_N": F.tensor([[0, 3], [4, 5], [6, 10]], dtype=idtype)}
edge_map = {
("_N", "_E", "_N"): F.tensor([[0, 9], [10, 15], [16, 25]], dtype=idtype)
}
ntypes = {ntype: i for i, ntype in enumerate(node_map)}
etypes = {etype: i for i, etype in enumerate(edge_map)}
book = gpb.RangePartitionBook(
0, 3, node_map, edge_map, ntypes, etypes
)
book = gpb.RangePartitionBook(0, 3, node_map, edge_map, ntypes, etypes)
partition = gpb.get_node_partition_from_book(book, F.ctx())
assert partition.num_parts() == 3
assert partition.array_size() == 11
......
import unittest
import backend as F
import dgl
import networkx as nx
import utils as U
from test_utils import parametrize_idtype
import dgl
def create_graph(idtype):
g = dgl.from_networkx(nx.path_graph(5), idtype=idtype, device=F.ctx())
......
import unittest
import backend as F
import numpy as np
import dgl
import numpy as np
@unittest.skipIf(
......
import unittest
import backend as F
import dgl
import networkx as nx
import numpy as np
import pytest
from test_utils import parametrize_idtype
from test_utils.graph_cases import get_cases
import dgl
@parametrize_idtype
def test_sum_case1(idtype):
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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