Ask for advice in pytorch extension

Hello, I am new at pytorch extension. I want some advice in pytorch extension development. Assume I propose a new convolution kernel (for example, assume I am the first one who propose the deformable conv :joy: :sweat_smile:), and I have to implement it in cuda and C++.

As the deformable conv is complex,

(1) how can I know if my implement is right?
(2) how can I know if the gradient (in backward) is right?

Any helpful experience is ok.

@JTiC
I suggest you to take a look at this instruction first.
https://pytorch.org/tutorials/advanced/cpp_extension.html
And then take a look at how to install the libtorch here:
https://pytorch.org/cppdocs/installing.html

We can not automatically test whether your code’s logic is correct or not since that’s your own implementation. But you can write test case to run your code to check whether the output result is what you want.

1 Like

Thank you, it is helpful! :smiley: