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
...@@ -264,7 +264,6 @@ def test_csc_to_csr(dense_dim, indptr, indices, shape): ...@@ -264,7 +264,6 @@ def test_csc_to_csr(dense_dim, indptr, indices, shape):
@pytest.mark.parametrize("col", [(0, 1, 2, 2), (1, 3, 3, 4)]) @pytest.mark.parametrize("col", [(0, 1, 2, 2), (1, 3, 3, 4)])
@pytest.mark.parametrize("shape", [None, (5, 5), (5, 6)]) @pytest.mark.parametrize("shape", [None, (5, 5), (5, 6)])
def test_coo_to_csc(dense_dim, row, col, shape): def test_coo_to_csc(dense_dim, row, col, shape):
val_shape = (len(row),) val_shape = (len(row),)
if dense_dim is not None: if dense_dim is not None:
val_shape += (dense_dim,) val_shape += (dense_dim,)
......
...@@ -2,12 +2,12 @@ import unittest ...@@ -2,12 +2,12 @@ import unittest
from statistics import mean from statistics import mean
import backend as F import backend as F
import numpy as np
import torch
import dgl import dgl
import dgl.ndarray as nd import dgl.ndarray as nd
import dgl.ops as OPS import dgl.ops as OPS
import numpy as np
import torch
from dgl import rand_graph from dgl import rand_graph
from dgl._ffi.streams import _dgl_get_stream, to_dgl_stream_handle from dgl._ffi.streams import _dgl_get_stream, to_dgl_stream_handle
from dgl.utils import to_dgl_context from dgl.utils import to_dgl_context
...@@ -138,6 +138,7 @@ def test_record_stream_graph_positive(): ...@@ -138,6 +138,7 @@ def test_record_stream_graph_positive():
stream = torch.cuda.Stream() stream = torch.cuda.Stream()
results2 = torch.zeros_like(result) results2 = torch.zeros_like(result)
# Performs the computing in a background stream # Performs the computing in a background stream
def perform_computing(): def perform_computing():
with torch.cuda.stream(stream): with torch.cuda.stream(stream):
...@@ -172,6 +173,7 @@ def test_record_stream_graph_negative(): ...@@ -172,6 +173,7 @@ def test_record_stream_graph_negative():
stream = torch.cuda.Stream() stream = torch.cuda.Stream()
results2 = torch.zeros_like(result) results2 = torch.zeros_like(result)
# Performs the computing in a background stream # Performs the computing in a background stream
def perform_computing(): def perform_computing():
with torch.cuda.stream(stream): with torch.cuda.stream(stream):
......
import io import io
import pickle import pickle
import dgl
import networkx as nx import networkx as nx
import torch import torch
import dgl
def _reconstruct_pickle(obj): def _reconstruct_pickle(obj):
f = io.BytesIO() f = io.BytesIO()
......
import os import os
import unittest import unittest
import dgl
import torch as th import torch as th
import torch.multiprocessing as mp import torch.multiprocessing as mp
import dgl
def sub_ipc(g): def sub_ipc(g):
print(g) print(g)
......
import backend as F import backend as F
import pytest
import torch
import dgl import dgl
import pytest
import torch
@pytest.mark.skipif( @pytest.mark.skipif(
......
from copy import deepcopy from copy import deepcopy
import backend as F import backend as F
import dgl
import dgl.function as fn
import dgl.nn.tensorflow as nn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
...@@ -15,10 +19,6 @@ from test_utils.graph_cases import ( ...@@ -15,10 +19,6 @@ from test_utils.graph_cases import (
random_graph, random_graph,
) )
import dgl
import dgl.function as fn
import dgl.nn.tensorflow as nn
def _AXWb(A, X, W, b): def _AXWb(A, X, W, b):
X = tf.matmul(X, W) X = tf.matmul(X, W)
......
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