From 9b62e8d01492e0315cded0d77b9abace1b71527d Mon Sep 17 00:00:00 2001 From: "Hongzhi (Steve), Chen" Date: Fri, 21 Oct 2022 13:32:52 +0800 Subject: [PATCH] Revert "[Misc] Isort tutorials/large/L1_large_node_classification.py (#4721)" (#4741) This reverts commit 9962b7bdfdd327d421725e2554e08dbf4fd68afb. --- tutorials/large/L1_large_node_classification.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tutorials/large/L1_large_node_classification.py b/tutorials/large/L1_large_node_classification.py index bc6f3a508836..4ff1aa5b76d4 100644 --- a/tutorials/large/L1_large_node_classification.py +++ b/tutorials/large/L1_large_node_classification.py @@ -25,6 +25,9 @@ # OGB already prepared the data as DGL graph. # +import dgl +import torch +import numpy as np from ogb.nodeproppred import DglNodePropPredDataset dataset = DglNodePropPredDataset("ogbn-arxiv") @@ -37,8 +40,6 @@ # simply get the graph and its node labels like this: # -import dgl - graph, node_labels = dataset[0] # Add reverse edges since ogbn-arxiv is unidirectional. graph = dgl.add_reverse_edges(graph) @@ -165,8 +166,6 @@ # the computation of the new features. # -import torch - mfg_0_src = mfgs[0].srcdata[dgl.NID] mfg_0_dst = mfgs[0].dstdata[dgl.NID] print(mfg_0_src) @@ -184,7 +183,6 @@ import torch.nn as nn import torch.nn.functional as F - from dgl.nn import SAGEConv @@ -289,9 +287,8 @@ def forward(self, mfgs, x): # It also saves the model with the best validation accuracy into a file. # -import numpy as np -import sklearn.metrics import tqdm +import sklearn.metrics best_accuracy = 0 best_model_path = "model.pt"