Unverified Commit 7a10bcb6 authored by Muhammed Fatih BALIN's avatar Muhammed Fatih BALIN Committed by GitHub
Browse files

[GraphBolt][Doc] Minor fixes and clarifications. (#7135)

parent 364cb718
...@@ -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
---------- ----------
......
...@@ -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
......
...@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment