I am doing some optimization on NMS, I write it by Cython.
since I have to compare it with original one, so I try to write a pytorch C++ extension,  I need INT to index, while Variable cannot do this, so I use Vector to restore result, but it seems that C++ extension needs a torch format data to return, and I have to convert Vector to Tensor. I tried torch:: from_blob, it runs fast but will be wrong after return as the pointer’s data has been released. if I get an INT point from an empty tensor and give it value one by one from the vector, it will be much slower, any idea to speed up it?
Cython can return vector as python list, so I am wondering can pytorch C++ extension do this too?
I also need to do a comparison in the GPU environment and taking data from GPU seems to cost a lot of time too. Is there any optimization can do on this?
Thanks for any help and ideas !!!    (°:з」∠)