Skip to content

Commit b8c0d82

Browse files
cleanup rdl.py, num_neighbors_dict only needs to be computed once (pyg-team#10321)
minor change, just noticed while playing around with it --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 82b0e48 commit b8c0d82

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/rdl.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,15 +634,16 @@ def main():
634634

635635
print("Preparing data loaders...")
636636
loader_dict = {}
637+
num_neighbors_dict = {
638+
edge_type: args.num_neighbors
639+
for edge_type in data.edge_types
640+
}
641+
637642
for split in ["train", "val", "test"]:
638643
table = task.get_table(split)
639644
print(f"Creating '{split}' dataloader with columns: "
640645
f"{list(table.df.columns)}")
641646
table_input = get_train_table_input(split_table=table, task=task)
642-
num_neighbors_dict = {
643-
edge_type: args.num_neighbors
644-
for edge_type in data.edge_types
645-
}
646647
loader_dict[split] = NeighborLoader(
647648
data=data,
648649
num_neighbors=num_neighbors_dict,

0 commit comments

Comments
 (0)