Solved by ptrblck in post #2 
              
              
                I think a lot of boilerplate code could be reduced by using a higher-level API on top of PyTorch such as Ignite, Catalyst, or PyTorch Lightning. These libraries provide a different level of abstraction and might still fit your use case. If I’m not mistaken, you have still the full control with you…