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
240cfd1c
"...text-generation-inference.git" did not exist on "cfa73b5c99bc009903fbc340f8b77a6d4674455d"
Commit
240cfd1c
authored
Apr 21, 2018
by
zzhang-cn
Browse files
fix repr name
parent
f7b4b69a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
mx.py
mx.py
+8
-6
No files found.
mx.py
View file @
240cfd1c
...
...
@@ -17,19 +17,21 @@ class mx_Graph(Graph):
for
n
in
self
.
nodes
:
self
.
set_repr
(
n
,
h_init
)
def
set_repr
(
self
,
u
,
h_u
,
name
=
None
):
def
set_repr
(
self
,
u
,
h_u
,
name
=
'h'
):
#import ipdb; ipdb.set_trace()
assert
u
in
self
.
nodes
kwarg
=
{
name
:
h_u
}
self
.
add_node
(
u
,
**
kwarg
)
'''
if name == None:
self.add_node(u, h=h_u)
else:
self.add_node(u, name=h_u)
'''
def
get_repr
(
self
,
u
,
name
=
None
):
def
get_repr
(
self
,
u
,
name
=
'h'
):
assert
u
in
self
.
nodes
if
name
==
None
:
return
self
.
nodes
[
u
][
'h'
]
else
:
return
self
.
nodes
[
u
][
name
]
return
self
.
nodes
[
u
][
name
]
def
set_msg_func
(
self
,
func
=
None
,
u
=
None
):
"""Function that gathers messages from neighbors"""
...
...
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