get opengl texture data into libtorch tensor via cuda, then write the tensor data to new texture
#include <torch/torch.h> void get_texture_data(GLuint texture, int width, int height, torch::Tensor &out); void set_texture_data(GLuint texture, int width, int height, torch::Tensor &in);