Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zzhang-cn/dgl into 0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jermainewang committed Mar 8, 2019
2 parents c4082be + 2ade0ef commit 660f356
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/dgl/nodeflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions tests/scripts/build_dgl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 660f356

Please sign in to comment.