Skip to content

Commit

Permalink
[Doc] Fix the docstring of builtin functions. (dmlc#1303)
Browse files Browse the repository at this point in the history
* fix.

* fix.

* fix.

* fix cmake.
  • Loading branch information
zheng-da authored Mar 4, 2020
1 parent 6417458 commit ce93330
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions python/dgl/function/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,21 @@ def copy_e(e, out):

def _gen_message_builtin(lhs, rhs, binary_op):
name = "{}_{}_{}".format(lhs, binary_op, rhs)
docstring = """Builtin message function that computes message by performing
binary operation {} between {} feature and {} feature.
docstring = """Builtin message function that computes a message on an edge
by performing element-wise {} between features of {} and {}
if the features have the same shape; otherwise, it first broadcasts the features
to a new shape and performs the element-wise operation.
Broadcasting follows NumPy semantics. Please see
https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
for more details about the NumPy broadcasting semantics.
Parameters
----------
{} : str
The {} feature field.
{} : str
The {} feature field.
lhs_field : str
The feature field of {}.
rhs_field : str
The feature field of {}.
out : str
The output message field.
Expand All @@ -187,8 +193,8 @@ def _gen_message_builtin(lhs, rhs, binary_op):
""".format(binary_op,
TargetCode.CODE2STR[_TARGET_MAP[lhs]],
TargetCode.CODE2STR[_TARGET_MAP[rhs]],
lhs, TargetCode.CODE2STR[_TARGET_MAP[lhs]],
rhs, TargetCode.CODE2STR[_TARGET_MAP[rhs]],
TargetCode.CODE2STR[_TARGET_MAP[lhs]],
TargetCode.CODE2STR[_TARGET_MAP[rhs]],
name)

def func(lhs_field, rhs_field, out):
Expand Down

0 comments on commit ce93330

Please sign in to comment.