Unverified Commit ce93330e authored by Da Zheng's avatar Da Zheng Committed by GitHub
Browse files

[Doc] Fix the docstring of builtin functions. (#1303)

* fix.

* fix.

* fix.

* fix cmake.
parent 64174583
...@@ -168,15 +168,21 @@ _TARGET_MAP = { ...@@ -168,15 +168,21 @@ _TARGET_MAP = {
def _gen_message_builtin(lhs, rhs, binary_op): def _gen_message_builtin(lhs, rhs, binary_op):
name = "{}_{}_{}".format(lhs, binary_op, rhs) name = "{}_{}_{}".format(lhs, binary_op, rhs)
docstring = """Builtin message function that computes message by performing docstring = """Builtin message function that computes a message on an edge
binary operation {} between {} feature and {} feature. 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 Parameters
---------- ----------
{} : str lhs_field : str
The {} feature field. The feature field of {}.
{} : str rhs_field : str
The {} feature field. The feature field of {}.
out : str out : str
The output message field. The output message field.
...@@ -187,8 +193,8 @@ def _gen_message_builtin(lhs, rhs, binary_op): ...@@ -187,8 +193,8 @@ def _gen_message_builtin(lhs, rhs, binary_op):
""".format(binary_op, """.format(binary_op,
TargetCode.CODE2STR[_TARGET_MAP[lhs]], TargetCode.CODE2STR[_TARGET_MAP[lhs]],
TargetCode.CODE2STR[_TARGET_MAP[rhs]], TargetCode.CODE2STR[_TARGET_MAP[rhs]],
lhs, TargetCode.CODE2STR[_TARGET_MAP[lhs]], TargetCode.CODE2STR[_TARGET_MAP[lhs]],
rhs, TargetCode.CODE2STR[_TARGET_MAP[rhs]], TargetCode.CODE2STR[_TARGET_MAP[rhs]],
name) name)
def func(lhs_field, rhs_field, out): def func(lhs_field, rhs_field, out):
......
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