Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
ce93330e
Unverified
Commit
ce93330e
authored
Mar 04, 2020
by
Da Zheng
Committed by
GitHub
Mar 04, 2020
Browse files
[Doc] Fix the docstring of builtin functions. (#1303)
* fix. * fix. * fix. * fix cmake.
parent
64174583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
python/dgl/function/message.py
python/dgl/function/message.py
+14
-8
No files found.
python/dgl/function/message.py
View file @
ce93330e
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment