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
12f02c3c
Unverified
Commit
12f02c3c
authored
Nov 15, 2023
by
Will
Committed by
GitHub
Nov 16, 2023
Browse files
Update heterograph.py (#6506)
Co-authored-by:
Hongzhi (Steve), Chen
<
chenhongzhi.nkcs@gmail.com
>
parent
c76a43ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
python/dgl/heterograph.py
python/dgl/heterograph.py
+5
-3
tests/python/common/function/test_basics.py
tests/python/common/function/test_basics.py
+13
-0
No files found.
python/dgl/heterograph.py
View file @
12f02c3c
...
@@ -6061,7 +6061,9 @@ class DGLGraph(object):
...
@@ -6061,7 +6061,9 @@ class DGLGraph(object):
old_eframes
=
self
.
_edge_frames
old_eframes
=
self
.
_edge_frames
self
.
_node_frames
=
[
fr
.
clone
()
for
fr
in
self
.
_node_frames
]
self
.
_node_frames
=
[
fr
.
clone
()
for
fr
in
self
.
_node_frames
]
self
.
_edge_frames
=
[
fr
.
clone
()
for
fr
in
self
.
_edge_frames
]
self
.
_edge_frames
=
[
fr
.
clone
()
for
fr
in
self
.
_edge_frames
]
try
:
yield
yield
finally
:
self
.
_node_frames
=
old_nframes
self
.
_node_frames
=
old_nframes
self
.
_edge_frames
=
old_eframes
self
.
_edge_frames
=
old_eframes
...
...
tests/python/common/function/test_basics.py
View file @
12f02c3c
...
@@ -677,6 +677,19 @@ def test_local_scope(idtype):
...
@@ -677,6 +677,19 @@ def test_local_scope(idtype):
foo
(
g
)
foo
(
g
)
# test exception handling
def
foo
(
g
):
try
:
with
g
.
local_scope
():
g
.
ndata
[
"hh"
]
=
F
.
ones
((
g
.
num_nodes
(),
1
))
# throw TypeError
1
+
"1"
except
TypeError
:
pass
assert
"hh"
not
in
g
.
ndata
foo
(
g
)
@
parametrize_idtype
@
parametrize_idtype
def
test_isolated_nodes
(
idtype
):
def
test_isolated_nodes
(
idtype
):
...
...
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