From 2ade0ef96d0afe4b6fc49a6cc06eceaf5247e4f2 Mon Sep 17 00:00:00 2001 From: Minjie Wang Date: Fri, 8 Mar 2019 17:07:17 -0500 Subject: [PATCH] [Hotfix] fix cython bug (#442) * fix cython bug * fix * fix --- python/dgl/nodeflow.py | 14 ++++++++------ tests/scripts/build_dgl.sh | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/python/dgl/nodeflow.py b/python/dgl/nodeflow.py index a1e0cbf7f196..08715f1e0711 100644 --- a/python/dgl/nodeflow.py +++ b/python/dgl/nodeflow.py @@ -413,9 +413,10 @@ def block_edges(self, block_id): The edge ids. """ layer0_size = self._layer_offsets[block_id + 1] - self._layer_offsets[block_id] - rst = _CAPI_NodeFlowGetBlockAdj(self._graph._handle, "coo", layer0_size, - self._layer_offsets[block_id + 1], - self._layer_offsets[block_id + 2]) + rst = _CAPI_NodeFlowGetBlockAdj(self._graph._handle, "coo", + int(layer0_size), + int(self._layer_offsets[block_id + 1]), + int(self._layer_offsets[block_id + 2])) idx = utils.toindex(rst(0)).tousertensor() eid = utils.toindex(rst(1)) num_edges = int(len(idx) / 2) @@ -446,9 +447,10 @@ def block_adjacency_matrix(self, block_id, ctx): fmt = F.get_preferred_sparse_format() # We need to extract two layers. layer0_size = self._layer_offsets[block_id + 1] - self._layer_offsets[block_id] - rst = _CAPI_NodeFlowGetBlockAdj(self._graph._handle, fmt, layer0_size, - self._layer_offsets[block_id + 1], - self._layer_offsets[block_id + 2]) + rst = _CAPI_NodeFlowGetBlockAdj(self._graph._handle, fmt, + int(layer0_size), + int(self._layer_offsets[block_id + 1]), + int(self._layer_offsets[block_id + 2])) num_rows = self.layer_size(block_id + 1) num_cols = self.layer_size(block_id) diff --git a/tests/scripts/build_dgl.sh b/tests/scripts/build_dgl.sh index 44282ad42ba9..483cc46c7fbe 100644 --- a/tests/scripts/build_dgl.sh +++ b/tests/scripts/build_dgl.sh @@ -15,5 +15,8 @@ popd pushd python rm -rf build *.egg-info dist pip3 uninstall -y dgl +# test install python3 setup.py install +# test inplace build (for cython) +python3 setup.py build_ext --inplace popd