The usual way of using C++ functions from Python is in the C++ extension tutorial 9. As you see there, Python torch.Tensors are automatically converted when you declare your function to take torch::Tensor & (optionally with const).
Best regards
Thomas