Hi,
The THCudaTensor_data function does no data retrieval. It simply returns a pointer to the beginning of where the tensor content is stored.
You should then use storage_offset, size and stride to find the offset with respect to this starting point for every element of the tensor you want to access.
The state is THC state that is given to all THC functions.
The return type is a pointer to the type contained in the tensor (like float* double* int*…) note that the data live on GPU for cuda tensor and cannot be accessed from C code.