Unverified Commit e16e895d authored by Minjie Wang's avatar Minjie Wang Committed by GitHub
Browse files

[Doc] fix some document warnings (#645)

* fix doc

* fix some format and warnings

* fix
parent 463807c5
......@@ -7,7 +7,7 @@ Graph Store -- Graph for multi-processing and distributed training
.. autoclass:: SharedMemoryDGLGraph
Querying the distributed setting
------------------------
--------------------------------
.. autosummary::
:toctree: ../../generated/
......@@ -26,7 +26,7 @@ Using Node/edge features
SharedMemoryDGLGraph.init_edata
Computing with Graph store
-----------------------
--------------------------
.. autosummary::
:toctree: ../../generated/
......
.. _apinodeflow:
NodeFlow -- Graph sampled from a large graph
=========================================
============================================
.. currentmodule:: dgl
.. autoclass:: NodeFlow
......
......@@ -3323,25 +3323,27 @@ class DGLGraph(DGLBaseGraph):
# pylint: disable=invalid-name
def to(self, ctx):
"""
Move both ndata and edata to the targeted mode (cpu/gpu)
"""Move both ndata and edata to the targeted mode (cpu/gpu)
Framework agnostic
Parameters
----------
ctx : framework specific context object
ctx : framework-specific context object
The context to move data to.
Examples (Pytorch & MXNet)
Examples
--------
>>> import backend as F
The following example uses PyTorch backend.
>>> import torch
>>> G = dgl.DGLGraph()
>>> G.add_nodes(5, {'h': torch.ones((5, 2))})
>>> G.add_edges([0, 1], [1, 2], {'m' : torch.ones((2, 2))})
>>> G.add_edges([0, 1], [1, 2], {'m' : torch.ones((2, 2))})
>>> G.to(F.cuda())
>>> G.to(torch.device('cuda:0'))
"""
for k in self.ndata.keys():
self.ndata[k] = F.copy_to(self.ndata[k], ctx)
for k in self.edata.keys():
self.edata[k] = F.copy_to(self.edata[k], ctx)
# pylint: enable=invalid-name
......@@ -558,12 +558,17 @@ class NodeFlow(DGLBaseGraph):
or not.
There are two types of an incidence matrix `I`:
* "in":
* ``in``:
- I[v, e] = 1 if e is the in-edge of v (or v is the dst node of e);
- I[v, e] = 0 otherwise.
* "out":
* ``out``:
- I[v, e] = 1 if e is the out-edge of v (or v is the src node of e);
- I[v, e] = 0 otherwise.
"both" isn't defined in the block of a NodeFlow.
Parameters
......
"""
.. _sampling:
.. _model-sampling:
NodeFlow and Sampling
=======================================
......
"""
.. _sampling:
.. _model-graph-store:
Large-Scale Training of Graph Neural Networks
=============================================
......
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