godspeed1989 / knn_pytorch

K-Nearest Neighbor in Pytorch by CUDA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pytorch KNN in CUDA

We calculate distance matrix and topk indices in Python. The CUDA code just gathers the nearest neighbor points with topk indices.

Install

cd knn_pytorch
make
python knn_pytorch.py

Notes

  • This repository works with pytorch 1.0
  • Works with batched tensors

About

K-Nearest Neighbor in Pytorch by CUDA


Languages

Language:Python 56.2%Language:C++ 25.2%Language:Cuda 17.6%Language:Makefile 1.0%