-
Notifications
You must be signed in to change notification settings - Fork 6.8k
A few operators on graphs stored as CSR #13290
Conversation
* create DGLSubgraph. * fix. * return old eids in node_subgraph.
* add csr_neighborhood op * update neighborhood sample * Update csr_neighborhood_sample-inl.h * Update csr_neighborhood_sample-inl.h * Update csr_neighborhood_sample.cc
* add csr_neighborhood op * update neighborhood sample * Update csr_neighborhood_sample-inl.h * Update csr_neighborhood_sample-inl.h * Update csr_neighborhood_sample.cc * Update csr_neighborhood_sample-inl.h * Update csr_neighborhood_sample.cc * Update csr_neighborhood_sample-inl.h
@eric-haibin-lin could you please review this PR? |
@mxnet-label-bot add [pr-awaiting-review] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good. A few questions about details
.describe(R"code(This operator implements the edge_id function for csr arrays, | ||
where output[i] = input[u[i], v[i]] if input[u[i], v[i]] is a non-zero element of input, | ||
otherwise output[i] will be -1. Both u and v should be 1D vectors. | ||
Example:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If csr.data contains zero values, would it be returned as 0 or -1? I don't see verification of "non-zero" when searching the value in csr.data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSR is a special CSR. Its value is edge Id, so it contains edge id 0. So when we search for edges, we only need to check if the location has a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I am aware of that. That's why I think it's not appropriate to put if input[u[i], v[i]] is a non-zero element of input
since it also returns elements that are zeros and stored in csr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. i have updated the comment.
Description
We can store a graph as an CSR matrix. In this case, the value in the matrix is the edge id starting from 0. These operators run on such special CSR matrices. This is joint work with @HyperZealot and @aksnzhy
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments