For CPU Tensors, I think that using the data<scalar_t>()(for contiguous tensors, otherwise you should use the accessor<scalar_t, dim> API) method along with std::memcpy can give near to optimal results.