Unverified Commit 3ddc7b4d authored by Jinjing Zhou's avatar Jinjing Zhou Committed by GitHub
Browse files

[Fix] clang warnings (#1618)


Co-authored-by: default avatarMinjie Wang <wmjlyjemaine@gmail.com>
parent a67ba946
...@@ -26,7 +26,7 @@ inline PickFn<IdxType> GetTopkPickFn(int64_t k, NDArray weight, bool ascending) ...@@ -26,7 +26,7 @@ inline PickFn<IdxType> GetTopkPickFn(int64_t k, NDArray weight, bool ascending)
return wdata[data[i]] < wdata[data[j]]; return wdata[data[i]] < wdata[data[j]];
}; };
} else { } else {
compare_fn = [wdata, data] (IdxType i, IdxType j) { compare_fn = [wdata] (IdxType i, IdxType j) {
return wdata[i] < wdata[j]; return wdata[i] < wdata[j];
}; };
} }
...@@ -36,7 +36,7 @@ inline PickFn<IdxType> GetTopkPickFn(int64_t k, NDArray weight, bool ascending) ...@@ -36,7 +36,7 @@ inline PickFn<IdxType> GetTopkPickFn(int64_t k, NDArray weight, bool ascending)
return wdata[data[i]] > wdata[data[j]]; return wdata[data[i]] > wdata[data[j]];
}; };
} else { } else {
compare_fn = [wdata, data] (IdxType i, IdxType j) { compare_fn = [wdata] (IdxType i, IdxType j) {
return wdata[i] > wdata[j]; return wdata[i] > wdata[j];
}; };
} }
......
...@@ -31,7 +31,7 @@ namespace network { ...@@ -31,7 +31,7 @@ namespace network {
static void NaiveDeleter(DLManagedTensor* managed_tensor) { static void NaiveDeleter(DLManagedTensor* managed_tensor) {
delete [] managed_tensor->dl_tensor.shape; delete [] managed_tensor->dl_tensor.shape;
delete [] managed_tensor->dl_tensor.strides; delete [] managed_tensor->dl_tensor.strides;
delete [] managed_tensor->dl_tensor.data; free(managed_tensor->dl_tensor.data);
delete managed_tensor; delete managed_tensor;
} }
......
...@@ -75,7 +75,7 @@ std::pair<dgl_id_t, bool> MetapathRandomWalkStep( ...@@ -75,7 +75,7 @@ std::pair<dgl_id_t, bool> MetapathRandomWalkStep(
return std::make_pair(-1, true); return std::make_pair(-1, true);
FloatArray prob_etype = prob[etype]; FloatArray prob_etype = prob[etype];
IdxType idx; IdxType idx = 0;
if (IsNullArray(prob_etype)) { if (IsNullArray(prob_etype)) {
// empty probability array; assume uniform // empty probability array; assume uniform
idx = RandomEngine::ThreadLocal()->RandInt(size); idx = RandomEngine::ThreadLocal()->RandInt(size);
......
...@@ -90,7 +90,7 @@ std::vector<IdArray> DegreeBucketing(const IdArray& msg_ids, const IdArray& vids ...@@ -90,7 +90,7 @@ std::vector<IdArray> DegreeBucketing(const IdArray& msg_ids, const IdArray& vids
ret.push_back(std::move(mids)); ret.push_back(std::move(mids));
ret.push_back(std::move(mid_section)); ret.push_back(std::move(mid_section));
return std::move(ret); return ret;
} }
template std::vector<IdArray> DegreeBucketing<int32_t>(const IdArray& msg_ids, template std::vector<IdArray> DegreeBucketing<int32_t>(const IdArray& msg_ids,
...@@ -161,7 +161,7 @@ std::vector<IdArray> GroupEdgeByNodeDegree(const IdArray& uids, ...@@ -161,7 +161,7 @@ std::vector<IdArray> GroupEdgeByNodeDegree(const IdArray& uids,
ret.push_back(std::move(new_eids)); ret.push_back(std::move(new_eids));
ret.push_back(std::move(sections)); ret.push_back(std::move(sections));
return std::move(ret); return ret;
} }
template std::vector<IdArray> GroupEdgeByNodeDegree<int32_t>( template std::vector<IdArray> GroupEdgeByNodeDegree<int32_t>(
......
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