How do I convert a Torch tensor to a C++ array without looping over all the dimensions ( I can do this, but is terribly slow) and std::memcpy has undefined behavior.
Using memcpy like this.
std::array<float, 327600> output_data;
at::Tensor output = *from some instructions*
std::memcpy(output_data.data(),output.data_ptr(),327600*sizeof(float));