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

Enable returning distances from knn and knn_graph #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chenzhekl
Copy link

@chenzhekl chenzhekl commented Jun 27, 2022

TL;DR Add a switch for knn and knn_graph to enable returning distances alongside the edge_index.

This code has been tested on CPU and CUDA 11.3 with PyTorch 1.11.0 on Ubuntu 18.04.

Related: pyg-team/pytorch_geometric#3010


I still cannot directly decorate knn and knn_graph with @torch.jit.script per your suggestions (pyg-team/pytorch_geometric#3010 (comment)). So I took a slightly different approach which was similar to pytorch/pytorch#37986. Though @torch.jit.script has to be removed from the above two functions, the code that uses those two functions can be correctly jitted. Is it OK with you? @rusty1s

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (dbcafbe) to head (a6a5aca).
Report is 29 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #133   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines           77       116   +39     
=========================================
+ Hits            77       116   +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

@github-actions github-actions bot added the stale label Dec 25, 2022
@rusty1s rusty1s added enhancement New feature or request and removed stale labels Dec 25, 2022
@github-actions
Copy link

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

@github-actions github-actions bot added the stale label Jun 24, 2023
@github-actions github-actions bot closed this Jul 8, 2023
@rusty1s rusty1s reopened this Jul 8, 2023
@github-actions github-actions bot removed the stale label Jul 9, 2023
Copy link

github-actions bot commented Jan 6, 2024

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

@github-actions github-actions bot added stale and removed stale labels Jan 6, 2024
Copy link

github-actions bot commented Jul 6, 2024

This pull request had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity.

@github-actions github-actions bot added stale and removed stale labels Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants