Create Tensor from data pointer


(Luca Kubin) #1

To get the address of the first element of a tensor one can call the method:

Tensor.data_ptr

I’m wondering if it would be possible to create a Tensor by knowing the device, the result obtained from Tensor.data_ptr and the Tensor shape.