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
c4791fd4
Unverified
Commit
c4791fd4
authored
Jul 29, 2021
by
Rhett Ying
Committed by
GitHub
Jul 29, 2021
Browse files
[bugfix] fix default ntypes/etypes consistency between dgl.DGLGraph and dgl.graph (#3198)
parent
2583ec59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
python/dgl/heterograph.py
python/dgl/heterograph.py
+2
-2
tests/compute/test_graph.py
tests/compute/test_graph.py
+8
-0
No files found.
python/dgl/heterograph.py
View file @
c4791fd4
...
...
@@ -39,8 +39,8 @@ class DGLHeteroGraph(object):
# pylint: disable=unused-argument, dangerous-default-value
def
__init__
(
self
,
gidx
=
[],
ntypes
=
[
'_
U
'
],
etypes
=
[
'_
V
'
],
ntypes
=
[
'_
N
'
],
etypes
=
[
'_
E
'
],
node_frames
=
None
,
edge_frames
=
None
,
**
deprecate_kwargs
):
...
...
tests/compute/test_graph.py
View file @
c4791fd4
...
...
@@ -369,6 +369,13 @@ def test_is_sorted():
assert
src_sorted
==
True
assert
dst_sorted
==
False
def
test_default_types
():
dg
=
dgl
.
DGLGraph
()
g
=
dgl
.
graph
(([],
[]))
assert
dg
.
ntypes
==
g
.
ntypes
assert
dg
.
etypes
==
g
.
etypes
if
__name__
==
'__main__'
:
test_query
()
test_mutation
()
...
...
@@ -377,3 +384,4 @@ if __name__ == '__main__':
test_find_edges
()
test_hypersparse_query
()
test_is_sorted
()
test_default_types
()
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