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
2ade0ef9
Unverified
Commit
2ade0ef9
authored
Mar 08, 2019
by
Minjie Wang
Committed by
GitHub
Mar 08, 2019
Browse files
[Hotfix] fix cython bug (#442)
* fix cython bug * fix * fix
parent
cd4f0a2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
python/dgl/nodeflow.py
python/dgl/nodeflow.py
+8
-6
tests/scripts/build_dgl.sh
tests/scripts/build_dgl.sh
+3
-0
No files found.
python/dgl/nodeflow.py
View file @
2ade0ef9
...
@@ -413,9 +413,10 @@ class NodeFlow(DGLBaseGraph):
...
@@ -413,9 +413,10 @@ class NodeFlow(DGLBaseGraph):
The edge ids.
The edge ids.
"""
"""
layer0_size
=
self
.
_layer_offsets
[
block_id
+
1
]
-
self
.
_layer_offsets
[
block_id
]
layer0_size
=
self
.
_layer_offsets
[
block_id
+
1
]
-
self
.
_layer_offsets
[
block_id
]
rst
=
_CAPI_NodeFlowGetBlockAdj
(
self
.
_graph
.
_handle
,
"coo"
,
layer0_size
,
rst
=
_CAPI_NodeFlowGetBlockAdj
(
self
.
_graph
.
_handle
,
"coo"
,
self
.
_layer_offsets
[
block_id
+
1
],
int
(
layer0_size
),
self
.
_layer_offsets
[
block_id
+
2
])
int
(
self
.
_layer_offsets
[
block_id
+
1
]),
int
(
self
.
_layer_offsets
[
block_id
+
2
]))
idx
=
utils
.
toindex
(
rst
(
0
)).
tousertensor
()
idx
=
utils
.
toindex
(
rst
(
0
)).
tousertensor
()
eid
=
utils
.
toindex
(
rst
(
1
))
eid
=
utils
.
toindex
(
rst
(
1
))
num_edges
=
int
(
len
(
idx
)
/
2
)
num_edges
=
int
(
len
(
idx
)
/
2
)
...
@@ -446,9 +447,10 @@ class NodeFlow(DGLBaseGraph):
...
@@ -446,9 +447,10 @@ class NodeFlow(DGLBaseGraph):
fmt
=
F
.
get_preferred_sparse_format
()
fmt
=
F
.
get_preferred_sparse_format
()
# We need to extract two layers.
# We need to extract two layers.
layer0_size
=
self
.
_layer_offsets
[
block_id
+
1
]
-
self
.
_layer_offsets
[
block_id
]
layer0_size
=
self
.
_layer_offsets
[
block_id
+
1
]
-
self
.
_layer_offsets
[
block_id
]
rst
=
_CAPI_NodeFlowGetBlockAdj
(
self
.
_graph
.
_handle
,
fmt
,
layer0_size
,
rst
=
_CAPI_NodeFlowGetBlockAdj
(
self
.
_graph
.
_handle
,
fmt
,
self
.
_layer_offsets
[
block_id
+
1
],
int
(
layer0_size
),
self
.
_layer_offsets
[
block_id
+
2
])
int
(
self
.
_layer_offsets
[
block_id
+
1
]),
int
(
self
.
_layer_offsets
[
block_id
+
2
]))
num_rows
=
self
.
layer_size
(
block_id
+
1
)
num_rows
=
self
.
layer_size
(
block_id
+
1
)
num_cols
=
self
.
layer_size
(
block_id
)
num_cols
=
self
.
layer_size
(
block_id
)
...
...
tests/scripts/build_dgl.sh
View file @
2ade0ef9
...
@@ -15,5 +15,8 @@ popd
...
@@ -15,5 +15,8 @@ popd
pushd
python
pushd
python
rm
-rf
build
*
.egg-info dist
rm
-rf
build
*
.egg-info dist
pip3 uninstall
-y
dgl
pip3 uninstall
-y
dgl
# test install
python3 setup.py
install
python3 setup.py
install
# test inplace build (for cython)
python3 setup.py build_ext
--inplace
popd
popd
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