Since you are using the tensor.data_ptr() you would not use ...sizeof(torch::kFloat32) * numel... but rather ...sizeof(float) * numel...
Try something like:
std::memcpy(cv_pointer, tensor.data_ptr(), tensor.numel() * sizeof(float));

Assuming you are using floats.
You may also want to have a look (Convert torch::tensor to cv::Mat 89 . from @mhubii )