Unverified Commit 2ade0ef9 authored by Minjie Wang's avatar Minjie Wang Committed by GitHub
Browse files

[Hotfix] fix cython bug (#442)

* fix cython bug

* fix

* fix
parent cd4f0a2b
...@@ -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)
......
...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment