Solved by mhubii in post #5 
              
              
                I think, the example was written prior to the stable release of libtorch. The way you would implement the torch::nn::Module now is as follows 
struct NetImpl : torch::nn::Module {       // replaced Net by NetImpl
  NetImpl()                                // replaced Net by NetImpl
      : conv1(tor…