What you describe is a bit like DLPack (DLManagedTensor on the C side), maybe that can help you achieve what you need.
In particular DLManagedTensor* toDLPack(const Tensor& src);, from ATen/DLConvertor.h (mind the o at the end).
Best regards
Thomas