@JTiC
I suggest you to take a look at this instruction first.
https://pytorch.org/tutorials/advanced/cpp_extension.html 3
And then take a look at how to install the libtorch here:
https://pytorch.org/cppdocs/installing.html 2
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.