Feature in Pytorch to integrate C++ code with python

Hi,

This might not be the right platform to ask this. I wrote my data preprocessing algorithm in C++ which generates variable tensor of sizes approximately (10000*30). I am using PyBind to get the tensor in getitem method of the dataloader. PyBind copies this tensor which is taking a lot of time in comparison to making my dataprocessing function r-type void.

Is there any feature or help in Pytorch which can solve this problem?