You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/11/30 18:41:10 UTC

[GitHub] eric-haibin-lin closed pull request #13463: fix docs errors in dgl_graph.cc

eric-haibin-lin closed pull request #13463: fix docs errors in dgl_graph.cc
URL: https://github.com/apache/incubator-mxnet/pull/13463
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/operator/contrib/dgl_graph.cc b/src/operator/contrib/dgl_graph.cc
index d9bcdd4b3f1..b81edcd7750 100644
--- a/src/operator/contrib/dgl_graph.cc
+++ b/src/operator/contrib/dgl_graph.cc
@@ -251,19 +251,24 @@ sets of vertices as input. For each set of vertices, it returns a pair
 of CSR matrices if return_mapping is True: the first matrix contains edges
 with new edge Ids, the second matrix contains edges with the original
 edge Ids.
-Example::
-  x=[[1, 0, 0, 2],
-     [3, 0, 4, 0],
-     [0, 5, 0, 0],
-     [0, 6, 7, 0]]
-  v = [0, 1, 2]
-  dgl_subgraph(x, v, return_mapping=True) =
-    [[1, 0, 0],
-     [2, 0, 3],
-     [0, 4, 0]],
-    [[1, 0, 0],
-     [3, 0, 4],
-     [0, 5, 0]]
+
+Example:
+
+   .. code:: python
+
+     x=[[1, 0, 0, 2],
+       [3, 0, 4, 0],
+       [0, 5, 0, 0],
+       [0, 6, 7, 0]]
+     v = [0, 1, 2]
+     dgl_subgraph(x, v, return_mapping=True) =
+       [[1, 0, 0],
+        [2, 0, 3],
+        [0, 4, 0]],
+       [[1, 0, 0],
+        [3, 0, 4],
+        [0, 5, 0]]
+
 )code" ADD_FILELINE)
 .set_attr_parser(ParamParser<DGLSubgraphParam>)
 .set_num_inputs([](const NodeAttrs& attrs) {
@@ -429,13 +434,17 @@ NNVM_REGISTER_OP(_contrib_edge_id)
 stored in a CSR matrix (the value of the CSR stores the edge Id of the graph).
 output[i] = input[u[i], v[i]] if there is an edge between u[i] and v[i]],
 otherwise output[i] will be -1. Both u and v should be 1D vectors.
-Example::
-  x = [[ 1, 0, 0 ],
-       [ 0, 2, 0 ],
-       [ 0, 0, 3 ]]
-  u = [ 0, 0, 1, 1, 2, 2 ]
-  v = [ 0, 1, 1, 2, 0, 2 ]
-  edge_id(x, u, v) = [ 1, -1, 2, -1, -1, 3 ]
+
+Example:
+
+   .. code:: python
+
+      x = [[ 1, 0, 0 ],
+           [ 0, 2, 0 ],
+           [ 0, 0, 3 ]]
+      u = [ 0, 0, 1, 1, 2, 2 ]
+      v = [ 0, 1, 1, 2, 0, 2 ]
+      edge_id(x, u, v) = [ 1, -1, 2, -1, -1, 3 ]
 
 The storage type of ``edge_id`` output depends on storage types of inputs
   - edge_id(csr, default, default) = default
@@ -500,7 +509,8 @@ NNVM_REGISTER_OP(_contrib_dgl_adjacency)
 .describe(R"code(This operator converts a CSR matrix whose values are edge Ids
 to an adjacency matrix whose values are ones. The output CSR matrix always has
 the data value of float32.
-Example::
+
+Example:
 
   x = [[ 1, 0, 0 ],
        [ 0, 2, 0 ],


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services