The TH level C-API is being nuked, it probably wont be around by the time the next major release of PyTorch happens.
You should move to using the ATen API. Look at examples in https://github.com/pytorch/pytorch/tree/master/aten/src/ATen/native 18 or this page: https://pytorch.org/tutorials/advanced/cpp_extension.html 19 for rough usage of the API.
The ATen API mirrors the PyTorch’s python API pretty closely in C++11.