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
1e8c645d
Unverified
Commit
1e8c645d
authored
Nov 04, 2022
by
Rhett Ying
Committed by
GitHub
Nov 04, 2022
Browse files
[Dist] fix max length to 80 introduced in deprecate etype PR (#4809)
parent
ed8e9c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
python/dgl/distributed/graph_partition_book.py
python/dgl/distributed/graph_partition_book.py
+13
-9
No files found.
python/dgl/distributed/graph_partition_book.py
View file @
1e8c645d
...
@@ -847,14 +847,15 @@ class RangePartitionBook(GraphPartitionBook):
...
@@ -847,14 +847,15 @@ class RangePartitionBook(GraphPartitionBook):
),
"The node types have invalid IDs."
),
"The node types have invalid IDs."
for
c_etype
,
etype_id
in
etypes
.
items
():
for
c_etype
,
etype_id
in
etypes
.
items
():
assert
isinstance
(
c_etype
,
tuple
)
and
len
(
c_etype
)
==
3
,
\
assert
isinstance
(
c_etype
,
tuple
)
and
len
(
c_etype
)
==
3
,
\
f
"Expect canonical edge type in a triplet of string, but got
{
c_etype
}
."
"Expect canonical edge type in a triplet of string, but got "
\
f
"
{
c_etype
}
."
etype
=
c_etype
[
1
]
etype
=
c_etype
[
1
]
self
.
_etypes
[
etype_id
]
=
etype
self
.
_etypes
[
etype_id
]
=
etype
self
.
_canonical_etypes
[
etype_id
]
=
c_etype
self
.
_canonical_etypes
[
etype_id
]
=
c_etype
if
etype
in
self
.
_etype2canonical
:
if
etype
in
self
.
_etype2canonical
:
# If one etype maps to multiple canonical etypes, empty
# If one etype maps to multiple canonical etypes, empty
tuple
#
tuple
is used to indicate such ambiguity casued by etype.
# is used to indicate such ambiguity casued by etype.
See more
#
See more
details in self.to_canonical_etype().
# details in self.to_canonical_etype().
self
.
_etype2canonical
[
etype
]
=
tuple
()
self
.
_etype2canonical
[
etype
]
=
tuple
()
else
:
else
:
self
.
_etype2canonical
[
etype
]
=
c_etype
self
.
_etype2canonical
[
etype
]
=
c_etype
...
@@ -863,9 +864,10 @@ class RangePartitionBook(GraphPartitionBook):
...
@@ -863,9 +864,10 @@ class RangePartitionBook(GraphPartitionBook):
),
"The edge types have invalid IDs."
),
"The edge types have invalid IDs."
# This stores the node ID ranges for each node type in each partition.
# This stores the node ID ranges for each node type in each partition.
# The key is the node type, the value is a NumPy matrix with two columns, in which
# The key is the node type, the value is a NumPy matrix with two
# each row indicates the start and the end of the node ID range in a partition.
# columns, in which each row indicates the start and the end of the
# The node IDs are global node IDs in the homogeneous representation.
# node ID range in a partition. The node IDs are global node IDs in the
# homogeneous representation.
self
.
_typed_nid_range
=
{}
self
.
_typed_nid_range
=
{}
# This stores the node ID map for per-node-type IDs in each partition.
# This stores the node ID map for per-node-type IDs in each partition.
# The key is the node type, the value is a NumPy vector which indicates
# The key is the node type, the value is a NumPy vector which indicates
...
@@ -1416,7 +1418,8 @@ class HeteroDataName(object):
...
@@ -1416,7 +1418,8 @@ class HeteroDataName(object):
self
.
_policy
=
NODE_PART_POLICY
if
is_node
else
EDGE_PART_POLICY
self
.
_policy
=
NODE_PART_POLICY
if
is_node
else
EDGE_PART_POLICY
if
not
is_node
:
if
not
is_node
:
assert
isinstance
(
entity_type
,
tuple
)
and
len
(
entity_type
)
==
3
,
\
assert
isinstance
(
entity_type
,
tuple
)
and
len
(
entity_type
)
==
3
,
\
f
"Expect canonical edge type in a triplet of string, but got
{
entity_type
}
."
"Expect canonical edge type in a triplet of string, but got "
\
f
"
{
entity_type
}
."
self
.
_entity_type
=
entity_type
self
.
_entity_type
=
entity_type
self
.
data_name
=
data_name
self
.
data_name
=
data_name
...
@@ -1439,7 +1442,8 @@ class HeteroDataName(object):
...
@@ -1439,7 +1442,8 @@ class HeteroDataName(object):
def
get_type
(
self
):
def
get_type
(
self
):
"""The type of the node/edge.
"""The type of the node/edge.
This is only meaningful in a heterogeneous graph.
This is only meaningful in a heterogeneous graph.
In homogeneous graph, type is '_N' for a node and '_N:_E:_N' for an edge.
In homogeneous graph, type is '_N' for a node and '_N:_E:_N' for an
edge.
"""
"""
return
self
.
_entity_type
return
self
.
_entity_type
...
...
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