Skip to content
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

Missing bounds checking when working on GPU #181

Closed
YichengDWu opened this issue Jun 1, 2022 · 1 comment · Fixed by #182
Closed

Missing bounds checking when working on GPU #181

YichengDWu opened this issue Jun 1, 2022 · 1 comment · Fixed by #182

Comments

@YichengDWu
Copy link
Contributor

YichengDWu commented Jun 1, 2022

Related to FluxML/NNlib.jl#411

using GraphNeuralNetworks
using CUDA
using Flux: gpu
g = rand_graph(10, 30) |> gpu
g = add_edges(g,[10],[10])
x = CUDA.rand(3, 9) #9<10!
apply_edges((xi, xj, e) -> xi .+ xj, g, xi=x, xj=x)

This won't throw an error. Maybe we can add

@assert size(xi)[end]==size(xj)[end]==g.num_nodes

inside apply_edges

@YichengDWu
Copy link
Contributor Author

Even if we have bounds checking we should still add this line of code since we also don't want size(x)[end]>g.num_nodes. It just doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant