Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
7a10bcb6
Unverified
Commit
7a10bcb6
authored
Feb 21, 2024
by
Muhammed Fatih BALIN
Committed by
GitHub
Feb 22, 2024
Browse files
[GraphBolt][Doc] Minor fixes and clarifications. (#7135)
parent
364cb718
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
12 deletions
+19
-12
python/dgl/graphbolt/base.py
python/dgl/graphbolt/base.py
+6
-6
python/dgl/graphbolt/dataloader.py
python/dgl/graphbolt/dataloader.py
+3
-1
python/dgl/graphbolt/impl/torch_based_feature_store.py
python/dgl/graphbolt/impl/torch_based_feature_store.py
+1
-0
python/dgl/graphbolt/internal/sample_utils.py
python/dgl/graphbolt/internal/sample_utils.py
+5
-5
python/dgl/graphbolt/itemset.py
python/dgl/graphbolt/itemset.py
+4
-0
No files found.
python/dgl/graphbolt/base.py
View file @
7a10bcb6
python/dgl/graphbolt/dataloader.py
View file @
7a10bcb6
...
@@ -84,7 +84,9 @@ class DataLoader(torch.utils.data.DataLoader):
...
@@ -84,7 +84,9 @@ class DataLoader(torch.utils.data.DataLoader):
everything after feature fetching in the main process. The datapipe
everything after feature fetching in the main process. The datapipe
is modified in-place as a result.
is modified in-place as a result.
Only works on single GPU.
When the copy_to operation is placed earlier in the data pipeline, the
num_workers argument is required to be 0 as utilizing CUDA in multiple
worker processes is not supported.
Parameters
Parameters
----------
----------
...
...
python/dgl/graphbolt/impl/torch_based_feature_store.py
View file @
7a10bcb6
...
@@ -63,6 +63,7 @@ class TorchBasedFeature(Feature):
...
@@ -63,6 +63,7 @@ class TorchBasedFeature(Feature):
tensor([[1, 2]])
tensor([[1, 2]])
3. Pinned CPU feature.
3. Pinned CPU feature.
>>> torch_feat = torch.arange(10).reshape(2, -1).pin_memory()
>>> torch_feat = torch.arange(10).reshape(2, -1).pin_memory()
>>> feature = gb.TorchBasedFeature(torch_feat)
>>> feature = gb.TorchBasedFeature(torch_feat)
>>> feature.read().device
>>> feature.read().device
...
...
python/dgl/graphbolt/internal/sample_utils.py
View file @
7a10bcb6
python/dgl/graphbolt/itemset.py
View file @
7a10bcb6
...
@@ -36,6 +36,7 @@ class ItemSet:
...
@@ -36,6 +36,7 @@ class ItemSet:
>>> from dgl import graphbolt as gb
>>> from dgl import graphbolt as gb
1. Integer: number of nodes.
1. Integer: number of nodes.
>>> num = 10
>>> num = 10
>>> item_set = gb.ItemSet(num, names="seed_nodes")
>>> item_set = gb.ItemSet(num, names="seed_nodes")
>>> list(item_set)
>>> list(item_set)
...
@@ -47,6 +48,7 @@ class ItemSet:
...
@@ -47,6 +48,7 @@ class ItemSet:
('seed_nodes',)
('seed_nodes',)
2. Single iterable: seed nodes.
2. Single iterable: seed nodes.
>>> node_ids = torch.arange(0, 5)
>>> node_ids = torch.arange(0, 5)
>>> item_set = gb.ItemSet(node_ids, names="seed_nodes")
>>> item_set = gb.ItemSet(node_ids, names="seed_nodes")
>>> list(item_set)
>>> list(item_set)
...
@@ -57,6 +59,7 @@ class ItemSet:
...
@@ -57,6 +59,7 @@ class ItemSet:
('seed_nodes',)
('seed_nodes',)
3. Tuple of iterables with same shape: seed nodes and labels.
3. Tuple of iterables with same shape: seed nodes and labels.
>>> node_ids = torch.arange(0, 5)
>>> node_ids = torch.arange(0, 5)
>>> labels = torch.arange(5, 10)
>>> labels = torch.arange(5, 10)
>>> item_set = gb.ItemSet(
>>> item_set = gb.ItemSet(
...
@@ -70,6 +73,7 @@ class ItemSet:
...
@@ -70,6 +73,7 @@ class ItemSet:
('seed_nodes', 'labels')
('seed_nodes', 'labels')
4. Tuple of iterables with different shape: node pairs and negative dsts.
4. Tuple of iterables with different shape: node pairs and negative dsts.
>>> node_pairs = torch.arange(0, 10).reshape(-1, 2)
>>> node_pairs = torch.arange(0, 10).reshape(-1, 2)
>>> neg_dsts = torch.arange(10, 25).reshape(-1, 3)
>>> neg_dsts = torch.arange(10, 25).reshape(-1, 3)
>>> item_set = gb.ItemSet(
>>> item_set = gb.ItemSet(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment