Skip to content

Commit

Permalink
[Bugfix] Update deprecated method name in load_graph.py (dmlc#2769)
Browse files Browse the repository at this point in the history
Method `dataset.num_labels` has been deprecated and replaced by `dataset.num_classes`.  
Updating the method name to avoid runtime warning.

Co-authored-by: Minjie Wang <[email protected]>
  • Loading branch information
andyxukq and jermainewang authored Mar 22, 2021
1 parent 0ff7127 commit e6f6c2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/pytorch/graphsage/load_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def load_reddit():
g = data[0]
g.ndata['features'] = g.ndata['feat']
g.ndata['labels'] = g.ndata['label']
return g, data.num_labels
return g, data.num_classes

def load_ogb(name):
from ogb.nodeproppred import DglNodePropPredDataset
Expand Down

0 comments on commit e6f6c2e

Please sign in to comment.