Skip to content

Commit a01c0c5

Browse files
Rhett-Yinglijialin03
authored andcommitted
[DistGB] fix prob attr not exist (dmlc#7783)
1 parent 7e48fd4 commit a01c0c5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/dgl/distributed/dist_dataloader.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ def __init__(self, g, nids, graph_sampler):
378378
self._dataset = utils.maybe_flatten_dict(self.nids)
379379

380380
# Add prob/mask into graphbolt partition's edge attributes if needed.
381-
Collator.add_edge_attribute_to_graph(self.g, self.graph_sampler.prob)
381+
if hasattr(self.graph_sampler, "prob"):
382+
Collator.add_edge_attribute_to_graph(
383+
self.g, self.graph_sampler.prob
384+
)
382385

383386
@property
384387
def dataset(self):
@@ -637,7 +640,10 @@ def __init__(
637640
self._dataset = utils.maybe_flatten_dict(self.eids)
638641

639642
# Add prob/mask into graphbolt partition's edge attributes if needed.
640-
Collator.add_edge_attribute_to_graph(self.g, self.graph_sampler.prob)
643+
if hasattr(self.graph_sampler, "prob"):
644+
Collator.add_edge_attribute_to_graph(
645+
self.g, self.graph_sampler.prob
646+
)
641647

642648
@property
643649
def dataset(self):

0 commit comments

Comments
 (0)