Thanks for your quick help!  And could I move the GPU data to CPU using .cpu and then access each element in the tensor? I tried tensor[0].cpu().data but it failed with "tensors.c10::ArrayRef::operator[]at::Tensor(0ul).at::Tensor::cpu’ does not have class type "