Solved by vdg in post #3 
              
              
                For future reference, defining a torch module will create a shared pointer to the object, and then torch::save can be used to copy policy net to target net. 
struct DQNImpl : torch::nn::Module
{
    torch::nn::Linear layer1;
    torch::nn::Linear layer2;
    torch::nn::Linear layer3;
   
    DQNImpl…