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

KGEModel.test attempts division by zero if no hits are found for the specified k #9936

Open
ACHinrichs opened this issue Jan 13, 2025 · 0 comments
Labels

Comments

@ACHinrichs
Copy link

🐛 Describe the bug

In KGEModel.test, if there is not a single hit for the given k the line
hits_at_k = int(torch.tensor(hits_at_k).sum()) / len(hits_at_k)
Attempts to perform a division by 0. Desired behavior in the case that no hits are found would be that hits_at_k gets set to 0.

Versions

[pip3] numpy==2.1.0
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] torch==2.5.1
[pip3] torch_geometric==2.5.3
[pip3] torch-kmeans==0.2.0
[pip3] torchmetrics==1.6.0
[pip3] torchvision==0.20.1
[pip3] triton==3.1.0
[conda] Could not collect

@ACHinrichs ACHinrichs added the bug label Jan 13, 2025
ACHinrichs added a commit to ACHinrichs/pytorch_geometric that referenced this issue Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant