If you have a CUDA tensor t in PyTorch t.data_ptr<float>() will give you the float* to the tensor’s memory. You would have to deal with sizes, strides etc. yourself.
There also is from_blob to make a tensor pointing to a given memory blob, but you have to guarantee that the pointer will stay valid for the tensor’s lifetime (until the deleter callback that you can pass is called by PyTorch to signal that it’s done using it). TensorOptions allow you to specify that it is a GPU tensor and the dtype etc.
Best regards
Thomas