No I do not use that. But I do return a buffer cv::Mat buffer, which is accessed by py::bufer_info and is converted to numpy array then. This numpy array is then converted to numpy array by torch.from_numpy.