Process finished with exit code 139 (interrupted by signal 11: SIGSEGV): convert torch::Tensor to std::vector!

When convert a torch::Tensor to std::vector, i got the problem Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).
This is my convert code:
std::vector<double> conv_w(conv_weight.data_ptr<double>(),conv_weight.data_ptr<double>() + conv_weight.numel());

The reason why arise this error is that my torch::Tensor is in c10::kCUDA, but i want copy its content to c10::CPU’s std::vector. So it cause SIGSEGV error.