Skip to content

Commit

Permalink
upd (dmlc#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 authored Mar 6, 2020
1 parent 19797bb commit 09ade2f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/source/developer/ffi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,5 @@ out their price:
Please note that containers are NOT meant for passing a large collection of
items from/to C APIs. It will be quite slow in these cases. It is recommended
to benchmark first. As an alternative, use NDArray for a large collection of
numerical values and use BatchedDGLGraph for a lot of graphs.
numerical values and use ``dgl.batch`` to batch a lot of ``DGLGraph``'s into
a single ``DGLGraph``.
3 changes: 2 additions & 1 deletion python/dgl/data/graph_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class GraphData(ObjectBase):
@staticmethod
def create(g: DGLGraph):
"""Create GraphData"""
assert g.batch_size == 1, "BatchedDGLGraph is not supported for serialization"
# TODO(zihao): support serialize batched graph in the future.
assert g.batch_size == 1, "Batched DGLGraph is not supported for serialization"
ghandle = g._graph
if len(g.ndata) != 0:
node_tensors = dict()
Expand Down
4 changes: 2 additions & 2 deletions python/dgl/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ def __init__(self,
self._batch_num_nodes = batch_num_nodes
self._batch_num_edges = batch_num_edges

# set parent if the graph is a induced subgraph.
# set parent if the graph is a subgraph.
self._parent = parent

def _create_subgraph(self, sgi, induced_nodes, induced_edges):
Expand Down Expand Up @@ -1893,7 +1893,7 @@ def batch_num_edges(self):

@property
def parent(self):
"""If current graph is a induced subgraph of a parent graph, return
"""If current graph is a subgraph of a parent graph, return
its parent graph, else return None.
Returns
Expand Down
2 changes: 1 addition & 1 deletion python/dgl/model_zoo/chem/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def forward(self, bg, feats):
Parameters
----------
bg : BatchedDGLGraph
bg : DGLGraph
Batched DGLGraphs for processing multiple molecules in parallel
feats : FloatTensor of shape (N, M1)
* N is the total number of atoms in the batched graph
Expand Down
2 changes: 1 addition & 1 deletion tests/compute/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_laplacian_lambda_max():
g = dgl.DGLGraph(nx.erdos_renyi_graph(N, 0.3))
l_max = dgl.laplacian_lambda_max(g)
assert (l_max[0] < 2 + eps)
# test BatchedDGLGraph
# test batched DGLGraph
N_arr = [20, 30, 10, 12]
bg = dgl.batch([
dgl.DGLGraph(nx.erdos_renyi_graph(N, 0.3))
Expand Down

0 comments on commit 09ade2f

Please sign in to comment.