Solved by justusschock in post #10 
              
              
                I quickly created a gist. However the code is not brandnew so i cannot guarantee it to work with the latest pytorch version. Maybe you have to do some minor changes to get it run. 
I am also unsure about the imports but I think I covered everything I used (and maybe a bit too much)