-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add heterogeneous add_self_loop support #345
Add heterogeneous add_self_loop support #345
Conversation
Regarding the method |
src/GNNGraphs/transform.jl
Outdated
|
||
n = get(g.num_nodes, src_t, 0) | ||
|
||
# By avoiding using haskey, this only calls ht_keyindex once instead of twice |
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.
# By avoiding using haskey, this only calls ht_keyindex once instead of twice |
These kinds of performance concerns for dictionary queries are irrelevant. The heavy operations are the copies and the concatenations. Therefore the concern here should be to make the code has readable as possible, which means using haskey in my opinion.
src/GNNGraphs/transform.jl
Outdated
s = [s; nodes] | ||
t = [t; nodes] | ||
else | ||
nodes = [1:n;] |
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.
This creates a cpu array even if the rest of graph lives on gpu. We should create a new array similar to one in the existing relations.
Update repo
…Bail/GraphNeuralNetworks.jl into add_self_loops-heterograph Pull from upstream
I believe this to now be initializing edge arrays with the correct type, but please check to confirm. I also extended the test cases marginally. Tests should pass on latest, but not on nightly, similarly to #356. |
nice, thanks! |
Here is the PR as discussed in #329.