Automatic differentiation and neural network layers in PyTorch Relevant documentation: OOP in Python If you need a refresher for object oriented programming in Python, have a look at this article Automatic differentiation in PyTorch AD basics in PyTorch Autograd details NNs in PyTorch Nice tutorial, building step-by-step to a full CNN on MNIST torch.functional reference torch.nn reference torch.optim reference How to save and load models